mirror of
https://github.com/NixOS/nix
synced 2024-10-18 00:16:11 -04:00
Merge e453e037df
into 806a91f7bf
This commit is contained in:
commit
b3791c7108
|
@ -88,7 +88,9 @@ All options not listed here are passed to `nix-store
|
||||||
cleared before the interactive shell is started, so you get an
|
cleared before the interactive shell is started, so you get an
|
||||||
environment that more closely corresponds to the “real” Nix build. A
|
environment that more closely corresponds to the “real” Nix build. A
|
||||||
few variables, in particular `HOME`, `USER` and `DISPLAY`, are
|
few variables, in particular `HOME`, `USER` and `DISPLAY`, are
|
||||||
retained.
|
retained. Note that the shell used to run commands is obtained from
|
||||||
|
[`NIX_BUILD_SHELL`](#env-NIX_BUILD_SHELL) / `<nixpkgs>` from
|
||||||
|
`NIX_PATH`, and therefore not affected by `--pure`.
|
||||||
|
|
||||||
- `--packages` / `-p` *packages*…
|
- `--packages` / `-p` *packages*…
|
||||||
|
|
||||||
|
@ -112,11 +114,28 @@ All options not listed here are passed to `nix-store
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
|
|
||||||
- `NIX_BUILD_SHELL`
|
- <span id="env-NIX_BUILD_SHELL">[`NIX_BUILD_SHELL`](#env-NIX_BUILD_SHELL)</span>
|
||||||
|
|
||||||
Shell used to start the interactive environment. Defaults to the
|
Shell used to start the interactive environment. Defaults to the
|
||||||
`bash` found in `<nixpkgs>`, falling back to the `bash` found in
|
`bash` from `bashInteractive` found in `<nixpkgs>`, falling back to
|
||||||
`PATH` if not found.
|
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}}
|
{{#include ./env-common.md}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue