Okay, I'll modify that. Ukraine hasn't been buying gas from Russia for about 5 years now. It buys gas from Europe, regardless of where it originates. If Russia cuts off the supply completely, Ukraine will buy whatever it needs from Europe (it also has enough of its own gas to supply its households, just not its industry).
>I heard Russia is willing to give up some of that in exchange for some rubles
I won't wish Russia good luck in this endeavour past 2023-2024, but I will note that it'll need all the luck it can get.