Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Wiki suggests builtins.fetchurl takes a 'hash' parameter #44

Open
nmattia opened this issue Dec 17, 2022 · 2 comments
Open

Wiki suggests builtins.fetchurl takes a 'hash' parameter #44

nmattia opened this issue Dec 17, 2022 · 2 comments

Comments

@nmattia
Copy link

nmattia commented Dec 17, 2022

I'm not fixing directly since I don't know what the right way to do it is, but:

Screenshot 2022-12-17 at 17 31 07

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

@Mic92
Copy link
Member

Mic92 commented Dec 20, 2022

I could not find any instance of builtins.fetchurl using hash in the wiki. Where did you find this?

@nmattia
Copy link
Author

nmattia commented Dec 20, 2022

@Mic92 there is none, but since fetchurl is introduced without context I assumed it was builtins.fetchurl instead of nixpkgs' fetchurl, hence my confusion

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants