4 ms·
I came here to say this, too :) But, of course, it isn't a silver bullet... 1. You still have to have a sane PATH. A fair amount of the Nix install-related is
by abathur 5y ago
I came here to say this, too :)
But, of course, it isn't a silver bullet...
1. You still have to have a sane PATH. A fair amount of the Nix install-related issues that get opened are PATH problems, and you can also run into problems with PATH in cron/launchd (as @tyingq noted).
2. You still have to know what the script depends on. This can get tricky beyond small scripts you wrote yourself. (I write a tool for discovering and ~linking/resolving external dependencies in Shell scripts, https://github.com/abathur/resholve https://github.com/abathur/resholve. As I've been working on converting some of nixpkgs' existing Shell packages to use it, I almost always find dependencies the initial packager missed.)
- Filligree 5y agoRe. 2- If you invoke nix-shell with --pure, then it'll erase most user state — PATH included — prior to invoking the script. I don't find much use for this, but it would be useful to ensure nothing that isn't an explicit dependency gets used.
- abathur 5y agoYes, `--pure` helps (and `env -i` can also help) but that's not the hard part of finding them all. It only really helps when there's no conditional logic or no options that can lead to the execution of different programs.