msteen / nix-prefetch

Prefetch any fetcher function call, e.g. a package source
MIT License
124 stars 11 forks source link

Do not depend on NIX_PATH #30

Open jtojnar opened 3 years ago

jtojnar commented 3 years ago

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.

TerrorJack commented 2 years ago

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.