They keep nukes to keep EU (well, NATO) out of the war. The gas is flowing because it's their last card, if they stop the gas they will lose it and EU will be forced to look for alternatives asap and won't come back.
Selling more to China is not a good short option because as I understand there is no infrastructure, most pipes go to the west. Russia needs this money to trade with China, they won't accept Rubble.