diff --git a/pkgs/build-support/fetchhg/default.nix b/pkgs/build-support/fetchhg/default.nix index 7f4ed2ff3e8c..d53e39699d35 100644 --- a/pkgs/build-support/fetchhg/default.nix +++ b/pkgs/build-support/fetchhg/default.nix @@ -30,14 +30,18 @@ lib.extendMkDerivation { outputHashAlgo = if finalAttrs.hash != null && finalAttrs.hash != "" then null else "sha256"; outputHashMode = "recursive"; - outputHash = lib.throwIf (hash != null && sha256 != null) "Only one of sha256 or hash can be set" ( - if finalAttrs.hash != null then - finalAttrs.hash - else if sha256 != null then - sha256 + outputHash = + if (hash != null && sha256 != null) then + throw "Only one of sha256 or hash can be set" else - "" - ); + ( + if finalAttrs.hash != null then + finalAttrs.hash + else if sha256 != null then + sha256 + else + "" + ); inherit url rev hash; inherit preferLocalBuild;