It's pretty dumb as a deterrent because a single miscalculation and it would set off a chain reaction that ends human civilization.
Think of it this way: because nuclear missiles are not immediately traceable to their country of origin, each nuclear-armed country will immediately launch at their perceived enemies without validating who attacked them. All it takes is one launch. This might deter a sane person but we are led by narcissists and these are not rational people.