Animals maximize fitness by modulating sleep and foraging strategies in response to changes in nutrient availability. Wild populations of the fruit fly, Drosophila melanogaster, display highly variable levels of starvation and desiccation resistance that differ in accordance with geographic location, nutrient availability, and evolutionary history. Further, flies potently modulate sleep in response to changes in food availability, and selection for starvation resistance enhances sleep, revealing strong genetic relationships between sleep and nutrient availability. To determine the genetic and evolutionary relationship between sleep and nutrient deprivation, we assessed sleep in flies selected for desiccation or starvation resistance. While starvation resistant flies have higher levels of triglycerides, desiccation resistant flies have enhanced glycogen stores, indicative of distinct physiological adaptations to food or water scarcity. Strikingly, selection for starvation resistance, but not desiccation resistance, leads to increased sleep, indicating that enhanced sleep is not a generalized consequence of higher energy stores. Thermotolerance is not altered in starvation or desiccation resistant flies, providing further evidence for context-specific adaptation to environmental stressors. F2 hybrid flies were generated by crossing starvation selected flies with desiccation selected flies, and the relationship between nutrient deprivation and sleep was examined. Hybrids exhibit a positive correlation between starvation resistance and sleep, while no interaction was detected between desiccation resistance and sleep, revealing that prolonged sleep provides an adaptive response to starvation stress. Therefore, these findings demonstrate context-specific evolution of enhanced sleep in response to chronic food deprivation, and provide a model for understanding the evolutionary relationship between sleep and nutrient availability.