The nitrogen used in the process is taken from the air, but hydrogen sources vary depending on when and where ammonia production is happening. (scientificamerican.com)
Stanford University researchers in 2005 assessed the environmental effects of three different hydrogen sources: coal, natural gas, and water electrolysis powered by wind. (scientificamerican.com)
Producing hydrogen through the electrolysis of water was something of a holy grail to the hydrogen crowd, but suffered from the same drawbacks as traditional hydrogen sources: we needed to burn coal to make power to make hydrogen to make power. (extremetech.com)