How many years can they maintain that without petroleum inputs?

Ammonia can be generated through electrolysis as feed-stock for Haber-Bosch to get nitrogen, so literally forever. The reason we use petroleum is because it's currently cheaper than solar PV electrolysis.