  We perform a cosmological analysis in which we allow the primordial power
spectrum of scalar perturbations to assume a shape that is different from the
usual power-law predicted by the simplest models of cosmological inflation. We
parameterize the free primordial power spectrum with a "piecewise cubic Hermite
interpolating polynomial" (PCHIP). We consider a 3+1 neutrino mixing model with
a sterile neutrino having a mass at the eV scale, which can explain the
anomalies observed in short-baseline neutrino oscillation experiments. We find
that the freedom of the primordial power spectrum allows to reconcile the
cosmological data with a fully thermalized sterile neutrino in the early
Universe. Moreover, the cosmological analysis gives us some information on the
shape of the primordial power spectrum, which presents a feature around the
wavenumber $k=0.002\,\text{Mpc}^{-1}$.
