Nukes in space don’t act the same as nukes in air. The total energy is the same, but the fireball needs an atmosphere, and you need the fireball to shift the energy from a point-like source of hard X-rays to a big ball of IR.
This is also why Project Orion isn’t quite as self-destructive as it seems at first glance.
I guess you could pave the Moon with a rover and some Fresnel lenses though?