From 1aea84e9f7dd54f2a0ce7e1bd60af72b5b8dc803 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Sat, 9 May 2026 20:34:07 -0400 Subject: [PATCH] stdenv.mkDerivation: inherit all builtins --- pkgs/stdenv/generic/make-derivation.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index d5272a522b05..7df90e856846 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -24,9 +24,9 @@ let extendDerivation filter filterAttrs + foldl' getDev head - foldl' intersectAttrs isAttrs isBool @@ -35,6 +35,7 @@ let isList isPath isString + listToAttrs mapAttrs mapNullable optional @@ -47,7 +48,10 @@ let subtractLists toExtension toFunction + typeOf unique + unsafeDiscardStringContext + unsafeGetAttrPos warnIf zipAttrsWith ; @@ -108,7 +112,7 @@ let let prev = rattrs final; thisOverlay = toExtension f0 final prev; - pos = builtins.unsafeGetAttrPos "version" thisOverlay; + pos = unsafeGetAttrPos "version" thisOverlay; in warnIf ( @@ -312,7 +316,7 @@ let unsafeDerivationToUntrackedOutpath = drv: if isDerivation drv && (!drv.__contentAddressed or false) then - builtins.unsafeDiscardStringContext drv.outPath + unsafeDiscardStringContext drv.outPath else drv; @@ -844,7 +848,7 @@ let then if separateDebugInfo' then debugCachedOutputChecks else cachedOutputChecks else - builtins.listToAttrs ( + listToAttrs ( map (name: { inherit name; value = @@ -899,11 +903,11 @@ let pos ? # position used in error messages and for meta.position ( if attrs.meta.description or null != null then - builtins.unsafeGetAttrPos "description" attrs.meta + unsafeGetAttrPos "description" attrs.meta else if attrs.version or null != null then - builtins.unsafeGetAttrPos "version" attrs + unsafeGetAttrPos "version" attrs else - builtins.unsafeGetAttrPos "name" attrs + unsafeGetAttrPos "name" attrs ), # Experimental. For simple packages mostly just works, @@ -973,7 +977,7 @@ let n: v: assert (isString v || isBool v || isInt v || isDerivation v) - || throw "The `env` attribute set can only contain derivation, string, boolean or integer attributes. The `${n}` attribute is of type ${builtins.typeOf v}."; + || throw "The `env` attribute set can only contain derivation, string, boolean or integer attributes. The `${n}` attribute is of type ${typeOf v}."; v ) env'; in