Warren Buffett’s Berkshire Hathaway Inc. is nearing a deal to buy Precision Castparts Corp., in an acquisition that could be valued at more than $30 billion and rank as the storied conglomerate’s largest ever.

A deal for Precision Castparts, which makes aircraft components and energy-production equipment, could be announced as soon as this coming week, people familiar with the matter said.