nixos - Loading dependencies from nixpkgs-unstable with nix-shell -
i on nixos 16.09 , want use packages in nixpkgs-unstable / nixos-unstable.
using nix-channel --add
, able add nixpkgs-unstable (user) channels , use install latest version of packages nix-env
.
however, understand while nix-env
depends on user-defined channels, nix-shell
instead depends on nix_path
environment variable, in 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
so shows problem: nix-shell
going use system-wide nixos 16.09 channel instead of user-defined nixpkgs-unstable channel.
right now, using workaround:
nix-shell -i nixpkgs=~/.nix-defexpr/channels/nixpkgs
it not pretty me. recommended way of doing this?
is add like:
export nix_path="nixpkgs=~/.nix-defexpr/channels/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels"
to .profile
? not pretty either.
welcome long-standing confusion nix-env
, nix_path
. explicitly stated, nix-env
doesn't use nix_path, makes (i think) nix tool doesn't respect nix_path
.
so, actual problem nix-env
here, not nix-shell
. i'll post bunch of issues on nix bug tracker this:
- https://github.com/nixos/nix/issues/993
- https://github.com/nixos/nix/issues/1067
- https://github.com/nixos/nix/issues/886
right now, using workaround:
so can see, isn't workaround. practice specify exact nixpkgs you'd use: roots channel version, channel version, upstream remote channel version, local git checkout or pinned git version.
Comments
Post a Comment