I use to like entering a nix-shell --pure to verify that a package was pure and included all it’s required runtime dependencies.
How can I do this with the new nix commands? nix develop or nix shell don’t seem to have anything similar except for --ignore-environment which is way more austere.
Note that nix shell will not execute shellHooks, so if you’re making use of pkg-config, python packages, or anything else that really relies on hooks, then you’re SOL.
Sorry to bring up an old thread but if anyone is looking for a similar solution to isolate dev environments from the host system I found that adding the following to the top of your shell hook does the trick:
export PATH=$(for input in $buildInputs; do echo -n "$input/bin:"; done | sed 's/:$//')
This assumes all of the packages you are setting in your PATH are in the bin dir of the derivation output… Also, you really need to set everything, so you will likely need to add coreutils or busybox to make the shell usable.
If there is a better trick to this please let me know, would love to learn