We perform a systematic analysis of generic string flux compactifications,
making use of Exceptional Generalized Geometry (EGG) as an organizing
principle. In particular, we establish the precise map between fluxes, gaugings
of maximal 4d supergravity and EGG, identifying the complete set of gaugings
that admit an uplift to 10d heterotic or type IIB supegravity backgrounds. Our
results reveal a rich structure, involving new deformations of 10d supergravity
backgrounds, such as the RR counterparts of the β-deformation. These new
deformations are expected to provide the natural extension of the
β-deformation to full-fledged F-theory backgrounds. Our analysis also
provides some clues on the 10d origin of some of the particularly less
understood gaugings of 4d supergravity. Finally, we derive the explicit
expression for the effective superpotential in arbitrary N = 1 heterotic or
type IIB orientifold compactifications, for all the allowed fluxes.Comment: 58 pages, 6 table