Skip to content

Commit 0157392

Browse files
committed
Update for changed approach to NIX_PATH in nix.sh
1 parent 16c87ef commit 0157392

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/nix_integration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ You should either:
5656
2. add the command `source ~/.nix-profile/etc/profile.d/nix.sh` to your
5757
`~/.bashrc` or `~/.bash_profile` file.
5858

59+
A Nix path can be specified between angle brackets, e.g. `<nixpkgs>`, and the
60+
directories listed in the `NIX_PATH` environment variable will be searched for
61+
the given file or directory name. Stack makes use of path `<nixpkgs>`. From
62+
Nix 2.4, `NIX_PATH` is not set by `nix.sh`. If `NIX_PATH` is not set, Nix will
63+
fall back to (first) `$HOME/.nix-defexpr/channels` in impure and unrestricted
64+
evaluation mode. However, Stack may use a pure Nix mode (see further
65+
[below](#pure-and-impure-nix-shells)). That directory can be appended to
66+
`NIX_PATH` with
67+
`export NIX_PATH=${NIX_PATH:+$NIX_PATH:}$HOME/.nix-defexpr/channels`. For
68+
information about how Stack itself can configure `NIX_PATH`, see further
69+
[below](#nix-package-sources).
70+
5971
### Enable Nix integration
6072

6173
To enable Nix integration, add the following section to your Stack YAML

0 commit comments

Comments
 (0)