I doubt they’d give Iran nukes. It’s not like the Iranian government and people actually like them, sure they don’t hate them as much as they hate us, but Putin has to know that eventually some whacky Iranian will launch one at Moscow.
My guess is what the Russians are doing is building an infrastructure within Iran that they will be assuming control of in the future. Much like the German military did when they eventually defended their ally Italy from invasion. So the Iranians will be getting rolled and the Russians are not actually expecting to get paid for the infrastructure that they are building. They will just assume control due to forced default. There is too much oil in the Middle East for the Oil Barron's currently running Russia to write off. They want all the Spice. It controls transportation and will be vital when Global Cooling accelerates (last month sol had its weakest solar activity levels in about 100 years).