1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00

doc: Add example of default shell trickiness

This commit is contained in:
Vladimir Panteleev 2024-07-20 17:28:42 +00:00
parent 4a2b4907ca
commit e453e037df
No known key found for this signature in database
GPG key ID: 5004F0FAD051576D

View file

@ -120,6 +120,23 @@ All options not listed here are passed to `nix-store
`bash` from `bashInteractive` found in `<nixpkgs>`, falling back to
the `bash` found in `PATH` if not found.
Note that the default shell obtained using the method above may not
necessarily be the same as any shells requested in *path*. For
example, consider:
```nix
#!/usr/bin/env -S nix-shell --pure
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/854fdc68881791812eddd33b2fed94b954979a8e.tar.gz") {};
in
pkgs.mkShell {
buildInputs = pkgs.bashInteractive;
}
```
Despite `--pure`, the above will not result in a fully reproducible
shell environment.
{{#include ./env-common.md}}
# Examples