Comment by hnmullany
Soil nitrate fixation is also energy intensive. The nitrogenase enzyme takes about 27 ATPs to break a single N2 bond. Legumes feed about a third of their entire photosynthesis output to their nitrogen fixing nodules in order to generate significant amounts of nitrates.
There is no free lunch.