Gas flows and metal enrichment in and around simulated galaxies Galaxies are intimately connected to the environments they live in. The haloes around them contain the gas reservoir from which the galaxies grow, while galactic outflows heat and enrich this circumgalactic medium (CGM). The elemental abundances of present-day stars are, in part, set by these cosmic gas flows. Using zoom-in cosmological simulations of galaxies, I will discuss some of the physical and observable properties of gas and stars in and around galaxies. I will discuss how outflows from galaxies impact the CGM and the distribution of metals, focusing on the dependence on stellar feedback parameters and physical processes such as magnetic fields and thermal conduction. Finally, using the stars, which keep a historic record of the gas they formed from via their elemental abundances, I will discuss the distribution and potential origins of heavy elements produced via rapid neutron capture.