Not nuke it necessarily. Maybe just inject radioactive elements like those that helped keep the earth’s core hot for billions of years (uranium, potassium and thorium, primarily). Need a lot of it, though, and it’d probably have to come from off-planet... So that’d be a big problem... Just thinking out loud...
yes, that is what I meant - not explosion nukes but China Syndrome nuclear material to heat up and melt the core. Then in theory it spins like a dynamo creating a magnetic field.