I know I can just run it with a wrong hash. Is there any way to do that in a script? I thought nix-prefetch-url doesn’t support extraPostFetch.
Did you try the
Yes, I did. How can I use it with extraPostFetch?
nix-prefetch-url --unpack can only work for common
extraPostFetch, as there is no way to pass that data to the utility.
Depending on the use case, I usually just change the hash to all zeroes (or an empty string on newer Nix) and Nix will tell me the correct hash. Then I change the hash to the printed one manually.
Other times, especially when updating a package, I use
common-updater-scripts, which changes the hash in the Nix expression for me to one corresponding to the given version.
Then there is
nix-prefetch from the eponymous package should do what
nix-prefetch-url does but takes the data from an attribute so it should support
extraPostFetch. I have no experience with that, as I prefer to rely on manual TOFU or
Thanks for your tips!
nix-prefetch-url -A the-attribute.path.that-you-want-to-fetch.
EDIT: oh, the option isn’t documented in