nix-prefetch icon indicating copy to clipboard operation
nix-prefetch copied to clipboard

Do not depend on NIX_PATH

Open jtojnar opened this issue 3 years ago • 1 comments

When running the following on a system without any channels in Nix path, it fails:

$ nix-prefetch hello.src
warning: unknown setting 'experimental-features'
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

With more people starting to use flakes exclusively, it would be useful not to rely on NIX_PATH.

jtojnar avatar Oct 31 '21 09:10 jtojnar

Additional note: it's possible to run nix-prefetch --file /nix/store/path_to_nixpkgs ... to specify nixpkgs path, but that's not enough to get rid of NIX_PATH dependency directly because of https://github.com/msteen/nix-prefetch/blob/master/lib/lib.nix#L1.

TerrorJack avatar May 24 '22 07:05 TerrorJack