I know exactly where you are coming from. I'm a firefighter/paramedic, and lack of sleep can sap every last bit of energy from a guy. It's a tough battle, but you have to adapt.
Things that have worked for me:
1) Naps. Sounds silly, but even 3 hours can make you feel 100% better.
2) Diet. A person with a normal sleep pattern can handle the caffiene, booze, simple carbs, etc etc. I sure as hell know I can't. I've been in this line of work 10 years, and my tolerance for those 3 items has dramatically decreased. I still indulge once in a while, but they screw up my already-screwed sleep pattern big time.
3) Supplements, specifically vitamin B. I'm not sure why, but if I'm super-bagged, a multi-B, vit C and Vit E seems to be a pick-me-up. I can think clearer, and don't seem as "foggy".
Trying to get enough sleep as an emergency shiftworker is hard enough; trying to make and keep gains is a 24/7 task. It can be done; a guy I work with is a competative bodybuilder, with a family, and he does quite well. One of his habits is hitting the gym right after a nightshift; then he'll head home to catch some sleep after. Although I'm not a morning workout type of guy, I can see why he does this. I usually don't crash until a few hours after I get home from a nightshift.
Lack of sleep, besides making us feel like shit, starts all sorts of chemical reactions in the body, including increased release of cortisol, something you DO NOT want extra of when trying to pack on size. Going out of your way to try and get the proper amount of sleep can be tough, but it doable.
Good luck Bro!