Coarse-grained resource allocation models (C-GRAMs) are simple mathematical models of cell physiology, where large components of the macromolecular composition are abstracted into single entities. The dynamics and steady-state behaviour of such models provides insights on optimal allocation of cellular resources and have explained experimentally observed cellular growth laws, but current models do not account for the uptake of compound sources of carbon and nitrogen. Here, we formulate a C-GRAM with nitrogen and carbon pathways converging on biomass production, with parametrizations accounting for respirofermentative and purely respiratory growth. The model describes the effects of the uptake of sugars, ammonium and/or compound nutrients such as amino acids on the translational resource allocation towards proteome sectors that maximized the growth rate. It robustly recovers cellular growth laws including the Monod law and the ribosomal growth law. Furthermore, we show how the growth-maximizing balance between carbon uptake, recycling, and excretion depends on the nutrient environment. Lastly, we find a robust linear correlation between the ribosome fraction and the abundance of amino acid equivalents in the optimal cell, which supports the view that simple regulation of translational gene expression can enable cells to achieve an approximately optimal growth state.