The boxing idea is probably the best though also the most work. You should use reinforcing as well other wise the curbing will likely break up over time unless it's on a good foundation.
I'd consider using the timber attached to wooden stakes driven into the ground and screw or nail the 4 X 1 to the stakes to keep the 4 X 1 in shape. If you were to go down the boxing route you would need to be doing something similar but instead of just one side you'd need to do two sides for the boxing.
Nails driven into the soil as you were thinking of will be futile. The soil won't hold the nails in place for long.