17 , preferLocalBuild ? true
22 hasHash = (outputHash != "" && outputHashAlgo != "")
23 || md5 != "" || sha1 != "" || sha256 != "" || sha512 != "";
27 if (!hasHash) then throw "Specify sha for fetchipfs fixed-output derivation" else stdenv.mkDerivation {
29 builder = ./builder.sh;
30 nativeBuildInputs = [ curl ];
32 # New-style output content requirements.
33 outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
34 if sha512 != "" then "sha512" else if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
35 outputHash = if outputHash != "" then outputHash else
36 if sha512 != "" then sha512 else if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
38 outputHashMode = "recursive";
47 # Doing the download on a remote machine just duplicates network
48 # traffic, so don't do that.
49 inherit preferLocalBuild;