The problem, you have to pay careful attention to is the exact placement of the Nuke. It should be positioned in front of the direction of motion of the asteroid around the Sun. Also it needs to be placed slightly above the center line of the asteroid in relation to Earth. A large mass of water might be helpful. Maybe a donut shape. The Nuke will cause the water to instantly vaporize, and act to enhance the push, and slightly dampen the shock. Because the Nuke detonates in front of the asteroid it will act to slow the entire mass down a little bit. This causes the asteroid, and all the shards to fall inward towards the Sun, and will now be much below Earth's orbit. It might even fall into the Sun, gone forever. But, make no mistake, this will be tricky to pull off correctly.