When the argument to fetchurl defines executable = true, then outputModeHash gets set to "recursive". This causes nix-prefetch-url to want to unpack the downloaded file. Other tools, like nix-build, aren't affected by this issue.
Example
Lets assume we add/overlay following package:
{ fetchurl }:
fetchurl {
url = "https://nixos.org/releases/nix/nix-1.11.13/manual.pdf";
sha256 = "0g8pdb900b3mbq3wxy855qfwggcq6njv48g9fiq0jikbnbdmgclv";
executable = true;
}
Prefetching it will then fail as follows:
$ nix-prefetch-url -A pkgs.derp
downloading ‘https://nixos.org/releases/nix/nix-1.11.13/manual.pdf’... [0/0 KiB, 0.0 KiB/s]
unpacking...
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
error: program ‘tar’ failed with exit code 2
With executable = true removed, everything works as expected.
When the argument to
fetchurldefinesexecutable = true, thenoutputModeHashgets set to"recursive". This causesnix-prefetch-urlto want to unpack the downloaded file. Other tools, likenix-build, aren't affected by this issue.Example
Lets assume we add/overlay following package:
Prefetching it will then fail as follows:
With
executable = trueremoved, everything works as expected.