Buy it. You shoudl be swimming in energy, so just buy it off the market using monthly trades, or in chunks when your reserves get low. I spent the majority of my game on negative mineral income and it didn't really matter. (And for alloys, just buy the minerals in as required to keep however many factories you have running.)