From 789a15ef68b7c509ed7ff315ef9ea8ce0b4ac864 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 7 May 2026 21:53:49 -0400 Subject: [PATCH] stdenv.mkDerivation: move attrs removed for derivationArg to global scope --- pkgs/stdenv/generic/make-derivation.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index a3062c6024e2..bc8522a5cfec 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -194,6 +194,13 @@ let "disallowedRequisites" ]; + argumentAttrsToRemove = [ + "meta" + "passthru" + "pos" + "env" + ]; + attrsToRemoveLast = [ # Fixed-output derivations may not reference other paths, which means that # for a fixed-output derivation, the corresponding inputDerivation should @@ -917,12 +924,7 @@ let if attrs ? meta.mainProgram then env // { NIX_MAIN_PROGRAM = attrs.meta.mainProgram; } else env; derivationArg = makeDerivationArgument ( - removeAttrs attrs [ - "meta" - "passthru" - "pos" - "env" - ] + removeAttrs attrs argumentAttrsToRemove // { ${if __structuredAttrs then "env" else null} = checkedEnv; cmakeFlags = makeCMakeFlags attrs;