While photic autotrophic cyanobacterial diazotrophs require light, P and iron for their activity, non-cyanobacterial diazotrophs may exploit a variety of metabolisms for their nutrition, including phototrophy in the sunlit layer, chemolithoautotrophy and chemoorganoheterotrophy, which could be also present in aphotic waters.
Source: wiktionary