A generalized Robertson–Walker spacetime is not, in general, a perfect fluid spacetime and the converse is not, in general, true. In this paper, we show that if a perfect fluid spacetime admits an η–ρ-Einstein soliton, then the integral curves generated by the velocity vector field u are geodesics and the acceleration vector vanishes. Also, we show that if a perfect fluid spacetime with Killing velocity vector field admits a gradient η–ρ-Einstein soliton, then the spacetime represents either dark matter era or, the acceleration vector vanishes. Next, we show that if a generalized Robertson–Walker spacetime admits an η–ρ-Einstein soliton, then it becomes a perfect fluid spacetime. Finally, we prove that in a dark matter fluid with vanishing vorticity satisfying gradient η–ρ-Einstein soliton in f(ℛ)-gravity with constant Ricci scalar, either the energy density and isotropic pressure are constant or, the potential function ψ remains invariant under the velocity vector u. Also, for two models f(ℛ)=eαℛ+αlogℛ and f(ℛ)=ℛn (α = constant and ℛ is the Ricci scalar of the spacetime), various energy conditions in terms of the Ricci scalar are examined and state that the Universe is in an accelerating phase and satisfies the weak, null and dominant energy conditions, but violate the strong energy condition.