Cosmic-ray electrons and nuclei interact with the Galactic interstellar gas and produce high-energy gamma rays. The production processes are mainly Bremsstrahlung and hadronic interactions. Their emission rate, called emissivity, provide a unique indirect probe of the cosmic-ray flux. We present a precise measure of the HI emissivity in the solar neighborhood performed by Fermi between 60 MeV and 40 GeV and the derived constraints on the interstellar cosmic-ray proton and alpha spectra.