US Eyes Building Nuclear Power Plants for Moon and Mars
usnews.com
usnews.com
On the Earth it is a big annoyance that solar energy is available half of the time, but because the Earth rotates in 24 hours and has an atmosphere, it easy to cope with the effects.
On the moon the night lasts two weeks so you need vastly more storage to ride out the night than you do on the Earth. Probably people will live under a few meters of dirt which will provide insulation, but it seems likely that a lunar factory won't run continuously. It would be nice to have a nuclear reactor at a moon base so there is a comfortable margin of energy supply in the night.
(A counter to that is that there are some spots near the poles which see the sun always and also are near possible volatile CHON deposits that could be game-changing)
Contrast that to full in-space manufacturing, say a solar sail factory based at an asteroid. There your solar array points at the sun 24-7 so potentially you can run the factory at more than twice the throughput and pay back the capital investment more quickly.
If, for instance, Musk got his starships to work you would probably land one on the moon with a bulldozer, turn it on its side and bury it, and that is the beginning of a moon habitat. It seems crazy to me that one would want to go to mars before getting boots on the ground highly comfortable on the moon. Martians would be so vulnerable to tech failures that they should have confidence that people live a boring life with the same kit they use on the moon.
The problem though is the motivation. If Starship was working, for instance, you could ship hydrogen fuel up to earth but produce the oxidizer on the moon and ship it up with a mass driver. This is not the miles-long device that Heinlein and O'Neill dreamed about but something like a scaled-up battleship gun. (e.g. the US Navy can buy a lunar escape velocity railgun today)
You could catch lunar oxygen near the Earth-Sun L2 point if you have a 2.5 km/s gun, with a 3.5 km/s gun and active guidance you could graze oxygen carriers against the Earth's atmosphere to land liquid O2 at LEO where it could refuel starships.
The byproduct of that lunar oxygen is likely to be iron. Astronauts dug up hematite ore as good as anything you would find on Earth -- in Science Fiction space economies are often aluminum based until iron asteroids are tapped, but the path to lunar iron+oxygen is short compared to Al.
Studies on the economics of Lunar LOX vs LOX from Earth don't show a consistent benefit from moon mining if you want the fuel in order to go to Mars.
Personally I would skip Mars and aim for exploitation of asteroids. As you move away from the sun you get more tarry gunk mixed in with your sand; it is like Saudi Arabia but instead of a little tar in your sand it is a little sand in your tar. Great for making food, plastics, trees, etc. Get out to the orbit of jupiter and you will be looking at 50% ice, methane, carbon monoxide and you'll need to use the Fischer-Tropsch process if you want tarry gunk.