diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index d4b46cf9e9d4..3cd64ed1c02f 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -61,6 +61,7 @@ in , md5 ? "" , sha1 ? "" , sha256 ? "" +, sha512 ? "" , recursiveHash ? false @@ -91,7 +92,7 @@ assert (urls == []) != (url == ""); let hasHash = showURLs || (outputHash != "" && outputHashAlgo != "") - || md5 != "" || sha1 != "" || sha256 != ""; + || md5 != "" || sha1 != "" || sha256 != "" || sha512 != ""; urls_ = if urls != [] then urls else [url]; in @@ -114,9 +115,9 @@ if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${s # New-style output content requirements. outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else - if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; + if sha512 != "" then "sha512" else if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; outputHash = if outputHash != "" then outputHash else - if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; + if sha512 != "" then sha512 else if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; outputHashMode = if (recursiveHash || executable) then "recursive" else "flat";