wiki
wiki copied to clipboard
Wiki suggests `builtins.fetchurl` takes a 'hash' parameter
I'm not fixing directly since I don't know what the right way to do it is, but:

and trying it out:
src = fetchurl {
url = "foo.zip";
hash = "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==";
};
gives:
error: undefined variable 'fetchurl'
and
src = builtins.fetchurl {
url = "foo.zip";
hash = "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==";
};
gives:
error: unsupported argument 'hash' to 'fetchurl'
until finally:
src = pkgs.fetchurl {
url = "foo.zip";
hash = "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==";
};
works, though this it's surprising that a seemingly Nix, general wiki entry documents nixpkgs-specific behavior
I could not find any instance of builtins.fetchurl using hash in the wiki. Where did you find this?
@Mic92 there is none, but since fetchurl
is introduced without context I assumed it was builtins.fetchurl
instead of nixpkgs' fetchurl
, hence my confusion