As far as I know, the big damage from Nuclear Weapons planetside is the massive blastwave that can pretty much scour the earth, with radiation and thermal damage bringing up the rear.
But in space there is no atmosphere to create a huge concussive and scouring blast wave, which means a nuclear weapon would have to rely on its all-directional thermal and radiation to do damage… but is that enough to actually be usful as a weapon in space, considering ships in space would be designed to handle radiation and extreme thermals due to the lack of any insulative atmosphere?
I know a lot of this might be supposition based on imaginary future tech and assumptions made about materials science and starship creation, but surely at least some rough guess could be made with regards to a thernonuclear detonation without the focusing effects of an atmosphere?
If I’ve learned anything from watching nuclear blasts in space on sci-fi shows, it’s that hasshak, dal shakka mel!
The electromagnetic pulse may not cause physical destruction, but it would likely disable any spacecraft without enough shielding in the blast.
Question is already answered, but. The BSG miniseries has a good nuke scene which is actually pretty reasonable: https://youtu.be/R-L4tVksGYc
Others have answered you question about non-directed nuclear blasts in space already. They don’t work the same way as in atmosphere; lack the blast or the thermal heat, etc. Enter the Casaba-Howitzer, a theoretical nuclear shaped charge that shoots a directed plasma stream at near light speed. This idea came about in the 60s along with nuclear blast propulsion.
Yamato cannon operational
You probably need to wrap the nuke in multiple layers of material. Some inner layer to absord as much energy as possible and transfers it as kinetic energy to an outer high-density layer to create extremly fast shrapnel.
Atomic Rockets has a whole page for this
https://projectrho.com/public_html/rocket/spacegunconvent.php