nix shell nixpkgs\#cowsay or nix run nixpkgs\#cowsay

is the flakes-way, preferred over nix-shell -p cowsay now (though nix ... cli is still 'experimental')... the above integrate with rest of the system better (MAN paths etc). I came across this when needing to read the mariadb man page but I couldn't get to it using only nix-shell -p mariadb.