If you have excess electricity, I always thought it would make sense to use the Birkeland–Eyde process [1].
From what I understand it is very energy inefficient, but scales down well.
[1] https://en.m.wikipedia.org/wiki/Birkeland%E2%80%93Eyde_proce...