From dded3e398fff143c3fc25e2e27db95c89f209fd3 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Tue, 26 May 2026 14:22:46 -0400 Subject: [PATCH] build-support/hg: remove throwIf usage --- pkgs/build-support/fetchhg/default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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;