No one will attack North Korea because they are backed by China. I'm not sure how nuclear weapons helps them unless they split from China. Maybe they make money selling the tech to others.
The DPRKs primary goal is preservation of the Kim regime above all else. That’s why the DPRK over the last 70+ years has focused on Juche, a principle of self-reliance. The vast majority of their weapon systems are of indigenous designs and manufacture. And why they have developed and deployed an independent nuclear deterrent.
China is a bit closer to DPRK though and shares a land border so its a but easier for them to assist.