I recently made a thread that looks at the possibility of quickly replacing the need for nitrogen fertiliser by adding more legume years to the crop rotation -
Can changes in crop rotation allow big ag to eliminate the need for synthetic fertiliser?
In short, it seems that yes, it can be done.
This post in particular discusses a paper that looks at
Integrating legumes to enhance cereal production: The relative inputs of fertiliser nitrogen and legume biological nitrogen fixation in major wheat and maize producing countries
This chart was very interesting in that paper
The final column shows the additional legume area required to make up the nitrogen shortfall, and in some places, like the USA, it's around 25%. Which is quite do-able by switching out one year of wheat or corn growing with a year of growing peas or beans.
My general take on the whole thing was that big ag could cope perfectly well without nitrogen fertiliser if we just ate more beans.
For small scale growing it's relatively easy to incorporate the use of urine, composting, gathering leaves and grass cuttings to use as mulch, that sort of thing. But it seems that a simple change in our diets to increase peas and beans and reduce wheat and corn would keep the food supply from Big Ag secure too.
In short,
eat more beans!