Old behaviour
The old nix-shell
allowed quoting compound commands like this:
$ nix-shell -p cowsay lolcat --command 'cowsay hello | lolcat'
_______
< hello >
-------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
That is, complex commands could be enclosed in quotes and would be parsed and interpreted by the shell.
New problem
The new nix shell
's --command
option treats quoted values as filenames, leading to errors such as this:
$ nix shell nixpkgs#{cowsay,lolcat} --command 'cowsay hello | lolcat'
error: --- SysError -------------------------------------------------- nix
unable to execute 'cowsay hello | lolcat': No such file or directory
Leaving out the quotes leads to errors such as this:
$ nix shell nixpkgs#{cowsay,lolcat} --command cowsay hello | lolcat
The program ‘lolcat’ is currently not installed. You can install it by typing:
nix-env -iA nixos.lolcat