about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2022-11-20 15:07:28 +0200
committerGitHub <noreply@github.com>2022-11-20 15:07:28 +0200
commit8181233059a8caf6f7bde1172c042a42883ecb56 (patch)
tree7de5f08cd4494cbeeb7b529e34022f4493450b9b /lib
parent6638106edfd3e7a1232c356c9ae4d672e5344753 (diff)
parent341e6fd558abde5b4f6609833ff503c8d1e9b379 (diff)
Merge pull request #201946 from Artturin/splicingstuff2
lib.overrideDerivation: override attrs in __spliced && splice.nix: start deprecating nativeDrv and crossDrv
Diffstat (limited to 'lib')
-rw-r--r--lib/customisation.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index cc9a9b1c55d0a..bd7ee3c83b8cf 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -38,12 +38,15 @@ rec {
       //
       (drv.passthru or {})
       //
-      (if (drv ? crossDrv && drv ? nativeDrv)
-       then {
-         crossDrv = overrideDerivation drv.crossDrv f;
-         nativeDrv = overrideDerivation drv.nativeDrv f;
-       }
-       else { }));
+      # TODO(@Artturin): remove before release 23.05 and only have __spliced.
+      (lib.optionalAttrs (drv ? crossDrv && drv ? nativeDrv) {
+        crossDrv = overrideDerivation drv.crossDrv f;
+        nativeDrv = overrideDerivation drv.nativeDrv f;
+      })
+      //
+      lib.optionalAttrs (drv ? __spliced) {
+        __spliced = {} // (lib.mapAttrs (_: sDrv: overrideDerivation sDrv f) drv.__spliced);
+      });
 
 
   /* `makeOverridable` takes a function from attribute set to attribute set and