Where possible, I like to use nuts and bolts in the assembly. It allows me to dismantle the model, which is a great benefit for assembly, painting, and maintenance. But there is the problem of how to prevent the nuts coming undone. Some people paint the nut with nail varnish, which holds it secure when dry. Nail varnish remover (acetone) can then be applied if it is necessary to remove the nut.

In larger thread sizes, locknuts are commercially available. These usually have a fibre or plastic insert that grips the thread of the bolt tightly enough to prevent the nut working loose in service, but allows the nut to be removed with a spanner. Such are not available in the small sizes that we use, but this is my version.

With a piercing saw, cut a slot half way across the nut, as shown in the photograph. Then flux and apply the soldering iron so that solder flows into the slot. Clean up the outside surfaces of the nut. Now try the nut on the bolt. If you are lucky, enough solder will have flowed through the slot to make the nut fit tightly, so that it needs a spanner to turn it. If too much solder has flowed, it won't go on at all. In that case, start a taper tap in the nut. Do not run the tap right through, but remove just enough solder so that the nut fits the thread tightly. If insufficient solder has flowed and the nut is still loose, apply the soldering iron again.

I've made locknuts in 8, 10, and 12 BA sizes this way, and I have no doubt it would work for smaller ones. I guess it would work for larger sizes, too, but would I want to use anything larger in O gauge?
Locknuts
Nick Baines   Model Engineering