From 020ce4ae440314c96c3e90569ff95e2e5b348de8 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 28 May 2026 00:15:36 -0400 Subject: [PATCH] build-support/fetchzip: remove warnIf usage warnIf sends our warning message through a function call, even if the warning condition doesn't trigger. This requires a lot of thunk allocation that can be easily avoided. --- pkgs/build-support/fetchzip/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix index 4376fef41085..4878ece47f76 100644 --- a/pkgs/build-support/fetchzip/default.nix +++ b/pkgs/build-support/fetchzip/default.nix @@ -106,9 +106,11 @@ lib.extendMkDerivation { ) + '' ${postFetch} - ${lib.warnIf (extraPostFetch != "") - "use 'postFetch' instead of 'extraPostFetch' with 'fetchzip' and 'fetchFromGitHub' or 'fetchFromGitLab'." - extraPostFetch + ${ + if extraPostFetch != "" then + lib.warn "use 'postFetch' instead of 'extraPostFetch' with 'fetchzip' and 'fetchFromGitHub' or 'fetchFromGitLab'." extraPostFetch + else + extraPostFetch } chmod 755 "$out" '';