From 49ec48c3dbd4b8fca343918d87684e8a25d9c1c4 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Thu, 10 Jul 2025 03:36:26 +0800 Subject: [PATCH] fetchhg: fix hash assertion; make overridable when sha256 set Fix commit ef2f8315bf53 ("fetchhg: make argument hash overridable") --- pkgs/build-support/fetchhg/default.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/build-support/fetchhg/default.nix b/pkgs/build-support/fetchhg/default.nix index 1e5e76ec4ca0..45319bad3f68 100644 --- a/pkgs/build-support/fetchhg/default.nix +++ b/pkgs/build-support/fetchhg/default.nix @@ -30,16 +30,14 @@ lib.extendMkDerivation { outputHashAlgo = if finalAttrs.hash != null && finalAttrs.hash != "" then null else "sha256"; outputHashMode = "recursive"; - outputHash = - lib.throwIf (finalAttrs.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 - else - "" - ); + 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 + else + "" + ); inherit url rev hash; inherit preferLocalBuild;