Note: This is only a speculative thought experiment. Even if you had the required nanotechnology, making the defense system would be a wasteful and provocative act. The economic abundance that can be provided by nanotechnology can be used to remove the motivations and needs for conflicts and arms race competitions. Although I will describe a partially successful defense against some nuclear weapons, a foe that has nukes and decent nanotechnology could defeat this. Plus just building a lot of nukes and firing a sequenced multiple shot would penetrate and damage the protective domes and overwhelm the protection.
One mile wide Buckminster Fuller proposed dome
Buckminster Fuller appears to have made the first specific proposal in 1965. Claiming that the geodesic dome had no practical limit on its size, he described a glass-panelled dome 3 km in diameter and 1.6 km tall spanning a portion of Manhattan Island; he claimed that it would reduce air pollution and provide comfortable weather all year. The dome would not fully enclose the area beneath it, as with most fictional domes, but would float on air at roughly the height of a contemporary skyscraper
The goal of the largest outer dome would be to resist unexploded nuclear devices from penetrating without being forced to explode. Then the hardened inner shells would resist the resulting nuclear blasts. So in this case the outer shells would fully enclose the city. They could have large panels that are open during times of peace.
An active outer shell with reactive armor or electric reactive armor.
The largest domes that have already been constructed:
The largest mast supported dome is the Millenium dome which is 365 meters in diameter.
Largest concrete reinforced dome 71 meters
Geodesic domes have been made 216 meters in size
Nanotechnology can make materials one hundred times stronger than ordinary concrete and rebar. Molecular manufacturing could make large dome shells of stronger materials.
How strong can the nanotech materials be?
Buried structures in the 1960s were made with 55psi. ICBM silos apparently had 2000psi. Command bunkers maybe 4000psi They were able to survive near hits within a few hundred meters.
Materials with higher compressive strength would help make a dome tougher.
On wikipedia discusses superconcrete
Several blocks of concretes were demonstrated with abnormally high compressive strengths between 50,000 and 60,000 PSI at 28 days. The blocks appeared to use an aggregate of steel fibres and quartz -- a mineral with a compressive strength of 160,000 PSI, much higher than typical high-strength aggregates such as granite (15,000-20,000 PSI).
Compressive strength additives with 160,000 PSI is about 1.1 GPa.
Boron carbide has a compressive strength of 440,000 psi Almost three times the strength of the reinforcing material in superconcrete.
The ultimate compressive strength of c-BN (cubic boron nitride) is between 4.15 and 5.33 gpa. So about 4 times better than steel fibres and quartz.
Diamond is still almost twice as good as cubic boron nitride and 8 to 10 times better than quartz. Mature molecular manufacturing and nanotechnology can use diamond as a building material.
This site had an article that discussed how Monolithic Domes that are buried up to 30 feet deep are able to withstand pressures up to 1 ton per square foot (2000 psf). This is 13 psi with relatively ordinary concrete and rebar (special concrete can be 15 to 20 times better now and diamond and nanomaterials about 150 times). The diamond and nanomaterial dome would be city sized and have an overall strength of about 2000 psi.
Nuclear weapons overpressure
An online nuclear blast calculator
For a one megaton bomb
15 psi: 2.46 km
5 psi: 4.52 km
2 psi: 7.92 km
1 psi: 11.67 km
One megaton blast radii
It seems to be about pi (3.1416) times the overpressure for half the distance closer
PSI meters away
The outer shell would just need to resist penetration by an unexploded nuke missile and force it to detonate.
The next shell (a monolithic dome with say 1300psi) would 200 meters farther in would then be able to resist the blast.
Big nuclear explosion. Castle Bravo Blast
15 psi: 9.07 km
5 psi: 16.66 km
2 psi: 29.16 km
1 psi: 42.98 km
PSI Meters from ground zero
Another shell 600 meters smaller than outside radius of largest shell
to resist a 50 megaton blast.
If the outer shell is a geodesic dome, then when pieces are knocked out then other pieces could be ready to be moved quickly back into place to regenerate the protection.
There would be other active defences to try and shoot down missiles and attacks.
Here is a chapter from an online reference on high performance
concrete with formulas.
nuclear bomb effects calculations