What going on here? nixos & nixpkgs

`◆ ~ ❯❯❯ nix-shell -p nix-info --run “nix-info -m”

  • system: "x86_64-linux"
  • host os: Linux 5.10.88, NixOS, 22.05 (Quokka)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.6.0pre20211217_6e6e998
  • channels(root): "nixos-21.05.4658.dde1557825c"
  • channels(user): "nixpkgs-21.11.334247.573095944e7"
  • nixpkgs: /home/user/.nix-defexpr/channels/nixpkgs

what am I using when i do nix-env -iA nixos.package vs nix-env -iA nixpkgs.package. normally only nixos only nixos should right ?

1 Like

nix-channels are user specific. Your user is following nixpkgs-21.11, and root is following 21.05.

Generally I just remove my user channel, as it will pick up the root channel as it’s listed last on NIX_PATH

I’m assuming you’re using flakes, as your host os was installed from 22.05pre


Yes I’m using flakes and loving them. my user pkg’s are managed through home-manager’s nixos module so i would think my user channel would track the inputs of my flake i.e master. the fact that my channels lag behind is annoying part I’m not actually sure what all uses the channels.

Any of the nix-* commands.

For flakes, I simply pin nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ], where inputs are your system’s flake inputs. That way, legacy commands and flake based commands use the same underlying nixpkgs source. One could then simply not bother with channels at all at that point.