profile
viewpoint

Ask questionsattribute 'nixpkgs' in selection path 'nixpkgs.hello' not found

Try running the following with Nix 2.0:

$ NIX_PATH=/nix/var/nix/profiles/per-user/root/channels nix run nixpkgs.hello
error: attribute 'nixpkgs' in selection path 'nixpkgs.hello' not found

This is different than how previous version of Nix worked.

Oddly settings 'nixpkgs' to anything in NIX_PATH (even something that doesn't exist) will fix this issue:

NIX_PATH='nixpkgs=asdf:/nix/var/nix/profiles/per-user/root/channels' nix run nixpkgs.hello
NixOS/nix

Answer questions teozkr

Oh, weird. 2.3.1 made it work fine for me after removing the workaround.

useful!
source:https://uonfu.com/
answerer
Teo Klestrup Röijezon teozkr Stockholm, Sweden I am moving to GitLab: https://gitlab.com/teozkr
Github User Rank List