Synthesis of organic compounds (as in living cells) by energy derived from inorganic chemical reactions.