Basically what I'm picturing is a slight variation of the usual model that relies on flux pinning (a.k.a quantum locking) to resist damage. The swarm has a macroscopic "core", some sort of electromagnetic field generator with an accompanying power source that directs the movements of simplistic superconducting nanomachines, allowing the swarm to flow like a liquid but also become rigid and nearly indestructible via flux pinning.
Additionally, the swarm expands not by the nanomachines themselves converting raw materials into more nanomachines, but by macroscopic manufactories smaller than the core but still visible to the naked eye that are hidden within the swarm. They're fed raw materials via some sort of mechanical peristalsis that they then convert either into more nanomachines for the swarm or additional manufactories to keep up with the processing needs of the swarm. Because of this method of construction, the swarm's growth is still frighteningly fast, but also limited by the surrounding environment, and definitely not exponential.
Finally, because of the nature of the method by which the swarm both moves and becomes invulnerable, it is immune to EMPs smaller than the field that coordinates the movements of the swarm.
Does this all sound scientifically plausible? Would it pass muster as hard sci fi? If so, how hard? I want to stick on the more realistic side of things here, even if the idea of city-destroying gray goo somewhat stretches the imagination.
EDIT: The goo takes on a number of different forms. At first it crashes to Earth as a meteor, then washes onto shore as a sort of thick carpet riding on the back of a tsunami, and then once the moss-like carpet has had time to grow it starts turning into a fuzzy, semi-subterranean blob-like mass, with cillia extending like branches from the main mass as the larger body slowly engulfs entire cities or regions like an amoeba, trapping everything inside. After it's finished with that phase, it assumes a starfish like shape and begins budding into many relatively smaller centipede-like bodies which crawl across the countryside in various directions, consuming everything in their path and leaving behind seeds for new swarms.