nixos-from-scratch/fetchurl.nix

22 lines
394 B
Nix
Raw Normal View History

2023-06-27 18:09:35 +02:00
{ 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;
})