  Interstellar chemistry is important for galaxy formation, as it determines
the rate at which gas can cool, and enables us to make predictions for
observable spectroscopic lines from ions and molecules. We explore two central
aspects of modelling the chemistry of the interstellar medium (ISM): (1) the
effects of local stellar radiation, which ionises and heats the gas, and (2)
the depletion of metals onto dust grains, which reduces the abundance of metals
in the gas phase. We run high-resolution (400 M$_\odot$ per baryonic particle)
simulations of isolated disc galaxies, from dwarfs to Milky Way-mass, using the
FIRE galaxy formation models together with the CHIMES non-equilibrium chemistry
and cooling module. In our fiducial model, we couple the chemistry to the
stellar fluxes calculated from star particles using an approximate radiative
transfer scheme, and we implement an empirical density-dependent prescription
for metal depletion. For comparison, we also run simulations with a spatially
uniform radiation field, and without metal depletion. Our fiducial model
broadly reproduces observed trends in HI and H2 mass with stellar mass, and in
line luminosity versus star formation rate for [CII] 158$\mu$m, [OI] 63$\mu$m,
[OIII] 88$\mu$m, [NII] 122$\mu$m and H$\alpha$ 6563A. Our simulations with a
uniform radiation field predict fainter luminosities, by up to an order of
magnitude for [OIII] 88$\mu$m and H$\alpha$ 6563A, while ignoring metal
depletion increases the luminosity of carbon and oxygen lines by a factor
$\approx$2. However, the overall evolution of the galaxy is not strongly
affected by local stellar fluxes or metal depletion, except in dwarf galaxies
where the inclusion of local fluxes leads to weaker outflows and hence higher
gas fractions.
