To be more specific the first draft of my shebang script (~/hmm
) yields
error: file ‘nixpkgs’ was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:13
when executed as is (just ~/hmm
).
The inserted second line as follows finally makes it work for me:
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=http://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz
#!nix-shell -i bash -p hello
print "hello"
#!nix-shell -p python2 -i python2
print "world"
Still IDK the reasons why the #!/usr/bin/env NIX_PATH... nix-shell
or even #!/usr/bin/env -S NIX_PATH... nix-shell
forms don’t work here.