I worked rotating shifts for years. In fact, for 6 years I kept a schedule of Sunday day shift, Monday-Tuesday graveyard shift, Wednesday-Thursday evening shift. How did I manage?
I'd bed down for 4 hours before taking on graveyard shifts, accepting cues from hypnagogic dreams. These are sleep-admitting dreams, typically of short duration before entering Stage 1 sleep. Once I encounter a hypnagogic dream, I can either bounce back to waking or ignore it and dive into Stage 1. A single cycle of sleep can easily be followed by a second cycle. I'd have enough energy that night to get through my shift, allowing to bed down again the following morning.
The difficult part pertained to hot weather. I installed an evaporative cooler. Not only did it drop the ambient room temperature, but the drone of the motor contributed to drowsiness through white noise.