umm, the explosive force of the nuke in question (whether it be an H- or an A-bomb) would be the only damaging factor. First, you'd have to get the shields down of the ship (if it has any), and then the explosive force would do about the damage of a semi-automatic burst of a higher powered laser weapon. Needless to say, you'd be better off with a meson bomb. . . .
and yes, the projectile would continue moving forever, because of the gravitational slingshot effect of planets and stars, and would only be slowed down by solar wind, but also, the solar wind might also be a contributing factor. . . .