We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using a nix-shell shebang in a script, nix-shell doesn't load shell.nix if it is not in the working directory.
This contradicts the nix-shell manpage:
If path is not given, nix-shell defaults to shell.nix if it exists, and default.nix otherwise.
user@xps ~/bug/nix-shell/subdir $ echo i-am-shell-nix >shell.nix user@xps ~/bug/nix-shell/subdir $ echo i-am-default-nix >default.nix user@xps ~/bug/nix-shell/subdir $ echo '#!/usr/bin/env nix-shell' >tool user@xps ~/bug/nix-shell/subdir $ chmod a+x tool user@xps ~/bug/nix-shell/subdir $ ./tool error: undefined variable 'i-am-shell-nix' at /home/user/bug/nix-shell/subdir/shell.nix:1:1 user@xps ~/bug/nix-shell/subdir $ cd .. user@xps ~/bug/nix-shell $ ./subdir/tool error: undefined variable 'i-am-default-nix' at /home/user/bug/nix-shell/subdir/default.nix:1:1 user@xps ~/bug/nix-shell $ rm subdir/default.nix user@xps ~/bug/nix-shell $ ./subdir/tool error: getting status of '/home/user/bug/nix-shell/subdir/default.nix': No such file or directory
The latter invocations should use shell.nix.
shell.nix
This is related to #496 but doesn't involve .
.
A workaround:
#!/usr/bin/env nix-shell #!nix-shell ./shell.nix
The text was updated successfully, but these errors were encountered:
I marked this as stale due to inactivity. → More info
Sorry, something went wrong.
Still broken on December's nixUnstable.
nixUnstable
nix-shell
Successfully merging a pull request may close this issue.
When using a nix-shell shebang in a script, nix-shell doesn't load shell.nix if it is not in the working directory.
This contradicts the nix-shell manpage:
The latter invocations should use
shell.nix
.This is related to #496 but doesn't involve
.
A workaround:
The text was updated successfully, but these errors were encountered: