They collect CO2 and water from air. The water is split via electrolysis to get hydrogen for the knallgas bacteria to feed on along with the CO2, minerals and ammonia. [1]
There is a path for the ammonia to be directly source from the air as well via plasma nitrogen fixation. [2]
Also, in case you don't know, "out of thin air" is an English idiom for "From nothing, as of something that has suddenly materialized. out of nowhere; out of nothing. ". [1]