From d4299caae9f5909e6dd338dc736f4d52a7a97589 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 26 Oct 2025 21:57:51 +0800 Subject: [PATCH] fetchzip: restructure with lib.extendMkDerivation (not formatted) --- pkgs/build-support/fetchzip/default.nix | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix index 246ab3ea155b..a5da6f22fb65 100644 --- a/pkgs/build-support/fetchzip/default.nix +++ b/pkgs/build-support/fetchzip/default.nix @@ -14,6 +14,19 @@ glibcLocalesUtf8, }: +lib.extendMkDerivation { + constructDrv = fetchurl; + + excludeDrvArgNames = [ + "extraPostFetch" + + # TODO(@ShamrockLee): Move these arguments to derivationArgs when available. + "extension" + "stripRoot" + ]; + + extendDrvArgs = + finalAttrs: { url ? "", urls ? [ ], @@ -41,7 +54,6 @@ let baseNameOf (if url != "" then url else builtins.head urls); in -fetchurl ( { inherit name; recursiveHash = true; @@ -97,12 +109,5 @@ fetchurl ( ''; # ^ Remove non-owner write permissions # Fixes https://github.com/NixOS/nixpkgs/issues/38649 - } - // removeAttrs args [ - "stripRoot" - "extraPostFetch" - "postFetch" - "extension" - "nativeBuildInputs" - ] -) + }; +}