I would like to point $NIX_PATH
to ~/.nix-defexpr/channels
instead of ~/.nix-defexpr/channels_root
as currently. I don't want to have to type that every time I run nix-env
. What's the right way of doing that?
-
1Might be helpful: unix.stackexchange.com/questions/377599/… – gmarmstrong Apr 4 '18 at 19:28
I would simply define the variable the way you want it in your ~/.profile
.
-
1
-
What statelessness? You update channels "imperatively" - that's how they're designed, so that by default you install from the latest-updated channel without having to specify e.g. the exact commit hash. – Vladimír Čunát Feb 19 '18 at 18:14
-
1Yes, but we try to keep the state in
/etc/nixos/configuration.nix
and not all over the place like in a regular Linux distro. I am hoping to have a tidy solution with which I can make a reproducible recipe. I may be using that to create cloud instances, or sharing configuration with colleagues. – dmvianna Feb 20 '18 at 10:50 -
1
I still want to know how to do it via configuration, but imperatively through an expression written in a file I can do
$ nix-env -if /this/file.nix -I ~/.nix-defexpr/channels
This way I'll be using the user's channels. Without it ~/.nix-defexpr/channels_root
is read instead. Which is what I'm trying to avoid here.