Open campbellcole opened 2 months ago
Any script that uses the nix-shell shebang when nix.monitored.enable = true; is interpreted as a Nix expression instead of the chosen interpreter.
nix.monitored.enable = true;
For example, the following script:
#! /usr/bin/env nix-shell #! nix-shell -i bash -p inotify-tools echo "test"
produces the following error:
error: undefined variable 'echo' at /fake/path/example.sh:4:1: 3| 4| echo "test" | ^ 5|
With the nix-monitored module enabled, is there any built-in way to access the original nix-shell binary? Perhaps this could be worked around by providing a nix-shell-unwrapped binary in the path (if that isn't already a thing).
nix-shell-unwrapped
Thanks
I just found a workaround. Using the flake shebang still works, so I just replaced my shebang with:
#! /usr/bin/env -S nix shell nixpkgs#inotify-tools --command bash # ...
Any script that uses the nix-shell shebang when
nix.monitored.enable = true;
is interpreted as a Nix expression instead of the chosen interpreter.For example, the following script:
produces the following error:
With the nix-monitored module enabled, is there any built-in way to access the original nix-shell binary? Perhaps this could be worked around by providing a
nix-shell-unwrapped
binary in the path (if that isn't already a thing).Thanks