nix
nix copied to clipboard
nix shell shebang support doesn't work
Describe the bug
using nix shell in shebang position as documented doesn't actually work!
Steps To Reproduce
- Create a file
foo.shwith the following content:
#!/usr/bin/env nix
#! nix shell nixpkgs#bash nixpkgs#hello nixpkgs#cowsay --command bash
hello | cowsay
chmod +x foo.sh./foo.sh- Error:
error: './foo.sh' is not a recognised command
Try 'nix --help' for more information.
Expected behavior
Running foo.sh should result in the same output as nix shell nixpkgs#{bash,hello,cowsay} -c bash -c 'hello | cowsay'
nix-env --version output
nix-env (Nix) 2.18.1
Priorities
Add :+1: to issues you find important.
nix-env --versionoutput nix-env (Nix) 2.18.1
This feature was only introduced in 2.19.
Prior to 2.19 only the previous nix-shell shebang worked. Closing as answered.