Are nuclear weapons a deterrent?
It has been said by many that the primary reason the Soviets never used nuclear weapons on us is because they knew we had them too, and would use them on them in retaliation. May be a tad simplistic, kind of a 'nutshell' description, but I think there is merit to that point-of-view.
We often try to keep other smaller nations from getting nuclear weapons. The stated rationale has been what they might do with them against their neighbors. There might be a grain of truth to that, but I suspect that the real reason we don't want them to have nuclear weapons is because we don't want them to use them against us should we decide to attack them.