To avoid an XY problem… I’m trying to do this so that I can install a recently published MELPA package in my emacsWithPackages
inside home-manager
. If there’s a better way to do this, I’m happy to hear it. Now, on with the show.
I see in nix-channel --help
that we’re supposed to:
-
nix-channel --update
to get new updates - now we can verify which version we’re on with
nix-instantiate --eval -E '(import <nixpkgs> {}).lib.nixpkgsVersion'
(or, since you get a warning,.lib.version
.)
This seems reasonable! But when I try it, I perpetually get the same version. Namely, 18.09pre151052.4477cf04b67
when I see that the latest nixpkgs-unstable
is 19.03pre152857.947ae71dcec
.
Now, curiously, if I run nix-channel --update --verbose
, I can see that the actual latest URL is being downloaded, but the nix-instantiate
call still returns the old version, and so do other things which import <nixpkgs>
.
Any ideas what’s going on here?
Bonus question, and I think this may be core to what’s happening here, how is <nixpkgs>
resolved in an expression? My searching is not turning up a lot about how that particular form of import works.
Software | Version |
---|---|
Nix | 2.1.1 |
macOS | 10.13.6 |
Edit: I started grepping around the main manual for <nixpkgs>
and found this:
Paths can also be specified between angle brackets, e.g.
<nixpkgs>
. This means that the directories listed in the environment variableNIX_PATH
will be searched for the given file or directory name.
In my case, that’s:
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs:/nix/var/nix/profiles/per-user/root/channels
Buuuuut it looks like the channels I am updating are actually at /nix/var/nix/profiles/per-user/brian-hicks
(this is where ~/.nix-defexpr/channels
links to.)
So what’s going on with my NIX_PATH
? Is this the problem? What should I tweak to make it look at the right place? I could just set this in my shell, but that feels like cheating—I’d like to understand the cause here so I can debug it on my own next time.