Created
October 31, 2018 15:39
-
-
Save shajra/2303b16db076df6b6954f9e326e39ac6 to your computer and use it in GitHub Desktop.
Can someone explain how NIX_PATH works?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I understand how names are set explicitly on NIX_PATH: | |
$ NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos \ | |
> nix eval nixpkgs.lib.version | |
"19.03pre155751.45a419ab5a2" | |
But this seems to indicate that raw paths can be put on NIX_PATH to override settings: | |
$ NIX_PATH=/home/tnks/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos \ | |
> nix eval nixpkgs.lib.version | |
"19.03pre155767.8070a6333f3" | |
However, this only seems to work when overriding, not in isolation: | |
$ NIX_PATH=/home/tnks/.nix-defexpr/channels \ | |
> nix eval nixpkgs.lib.version | |
error: attribute 'nixpkgs' in selection path 'nixpkgs.lib.version' not found | |
What is going on here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment