If Ukraine started a nuclear weapons program, they would be in violation of the NPT treaty. Sanctions and loss of Western support would be virtually guaranteed.
It's not so simple, because Ukraine will join NPT when we will have security assurances from nuclear countries. It found recently, that security assurances, given to Ukraine, either a) broken, b) fake, so Ukraine may claim that the essential step is not completed yet.
Ukraine already joined the NPT, in the 1990s. That's a done deal.
Ukraine does not automatically leave the NPT just because Russia violated the Budapest Memorandum; such a mechanism linking the two does not exist. Ukraine would have to explicitly leave the NPT, which they will not do.
Except it's just not going to happen. I don't believe in the stupid propaganda (that gets repeated here almost every week) that Ukraine was manipulated into this war, by Boris or anyone else. Ukraine is entirely independent and makes its own choices.
But the simple fact is, it doesn't have unlimited control over its destiny in this particular regard, and pretending otherwise won't change that fact. It is entirely dependent on Western help at this point -- its benefactors are 1000 percent against any further nuclear proliferation, and are infinitely more concerned about that issue than they are about the borders of Ukraine, or Ukraine's survival in any other sense. They have no interest in the inevitable and far wider confrontation with Russia that would ensue from such recklessness -- and they just aren't going to allow it.