I am on NixOS 16.09 and I want to use packages that are currently only in nixpkgs-unstable / nixos-unstable.
Using nix-channel --add , I was able to add nixpkgs-unstable to my (custom) channels and use it to install the latest version of some packages using nix-env .
However, I understand that although nix-env depends on user channels, nix-shell instead depends on the NIX_PATH environment NIX_PATH , in my case:
$ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
Thus, this clearly shows the problem: nix-shell will use the NIXOS 16.09 system-wide channel instead of the custom nixpkgs-unstable channel.
Right now, I'm using this workaround:
nix-shell -I nixpkgs=~/.nix-defexpr/channels/nixpkgs
It doesn't look very pretty to me. What would be the recommended way to do this?
Is it possible to add something like:
export NIX_PATH="nixpkgs=~/.nix-defexpr/channels/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels"
to my .profile ? This is also not very beautiful.
source share