diff options
author | Valentin Gagarin <valentin.gagarin@tweag.io> | 2023-03-23 00:10:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 00:10:17 +0100 |
commit | 0ced5132fd21af8a4892c94880174998d94aeeea (patch) | |
tree | a928cbb83a076e48906cce70d271ca7a588be39f | |
parent | 6dbce3215fa2e30e1daafcc70d6926cd97987612 (diff) | |
parent | 96129246ad7d64241a84d900aec5b105f9408f45 (diff) |
Merge pull request #6865 from zuzuleinen/manual-nix-path-empty
document what happens when NIX_PATH is empty
-rw-r--r-- | doc/manual/src/command-ref/env-common.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/manual/src/command-ref/env-common.md b/doc/manual/src/command-ref/env-common.md index c5d38db47..2be55be52 100644 --- a/doc/manual/src/command-ref/env-common.md +++ b/doc/manual/src/command-ref/env-common.md @@ -13,6 +13,17 @@ Most Nix commands interpret the following environment variables: e.g. `/home/eelco/Dev:/etc/nixos`. It can be extended using the [`-I` option](./opt-common.md#opt-I). + If `NIX_PATH` is not set at all, Nix will fall back to the following list in [impure](./conf-file.md#conf-pure-eval) and [unrestricted](./conf-file.md#conf-restrict-eval) evaluation mode: + + 1. `$HOME/.nix-defexpr/channels` + 2. `nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs` + 3. `/nix/var/nix/profiles/per-user/root/channels` + + If `NIX_PATH` is set to an empty string, resolving search paths will always fail. + For example, attempting to use `<nixpkgs>` will produce: + + error: file 'nixpkgs' was not found in the Nix search path + - [`NIX_IGNORE_SYMLINK_STORE`]{#env-NIX_IGNORE_SYMLINK_STORE}\ Normally, the Nix store directory (typically `/nix/store`) is not allowed to contain any symlink components. This is to prevent |