The Moon is only three days away, so besides recycled urine, this wouldn’t be an impediment to lunar settlements.
Seems to me that for half the synodic period (avg ~ 29.5 days) one could store heat in some medium, and for the other half, store “cold” in some medium, and then use those media to run a heat exchange engine, with the temperature difference between lunar day and night averaging around 500 degrees F.
Carnot and Sterling on the moon. Next on Oprah.