nixos-from-scratch/fetchurl.nix

22 lines
394 B
Nix

{ url
, outputHash
, executable ? false
, unpack ? false
, name ? baseNameOf (toString url)
}:
derivation ({
builder = "builtin:fetchurl";
outputHashMode = "recursive";
inherit name url executable unpack outputHash;
outputHashAlgo = if outputHash == "" then "sha256" else "";
system = "builtin";
# No need to double the amount of network traffic
preferLocalBuild = true;
})