I don't think there is ${stdenv.grep} or something like that. The shell is a special case.

Grep is part of stdenv, so it is in PATH. If it wasn't, you'd have to add gnugrep to buildInputs.