I still don't think this is gonna be a nuclear conflict. Maybe I am too much of an optimistic (I dunno how, the world is fucking burning), but I still think the Russian officers that would actually push the button wouldn't do it. A smoking husk of Ukraine doesn't get them much imo.
I share your optimism but not because I put my faith in the guys (not) pushing the button. Putin at his core and in terms of where he's coming from is a small time FSB thug who made it too big for his own good. Perpetualizing corruption to keep himself in power and amassing enormous wealth at the cost of his people was fun for about one and a half decades. What does a kid do when it gets bored of its newest toy? It demands more of course. There is no nuclear option because little Vladimir knows at that point his days of demanding more will be counted. No more backing from big brother Xi. And all the reason for NATO to actually step in.
Some draw the analogy that you never know what a cornered Pitbull is gonna do but I don't see that being applicable. His recent job reassignments show that he does not feel safe in his position as de-facto dictator anymore. He is much more worried for his domestic survival right now than anything going down on the international stage. He can't nuke his own mutineers thus he needs to keep everyone in rotation so their levels of influence don't get out of hand.
I can't tell you what endgame there is left for Vladolf Putler. The only way onward is to keep the war going, which probably will require a full transition to a wartime economy sooner than later, but he probably doesn't want that toll on the Russian people. Nuclear weapons would mean the opposite of keeping the war of attrition going and he knows that.
I think most of it is on Wikipedia. Ukraine really tried to hang on to the nukes but iirc after several years they couldn't make them work because they didn't have the command codes.
Even if they had been able to break the codes they'd have had their work cut out for them putting them back into working order, performing maintenance, aiming and launching them etc.
And after they managed all they'd have to deal with the fact these are ICMBs, they have a minimum range of 5000km. The only part of Russia they could've hit was Siberia.
Eventually they figured it's worth trading a bunch of useless weapons for a good deal with the West – who were the most interested in decomissioning those weapons because like I said they were aimed at them not at Russia.