summary refs log tree commit diff
path: root/lib/customisation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r--lib/customisation.nix29
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index a9281b1ab69..6dbe8f472f9 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -277,9 +277,24 @@ rec {
         };
     in self;
 
+  /* backward compatibility with old uncurried form; deprecated */
+  makeScopeWithSplicing =
+    splicePackages: newScope: otherSplices: keep: extra: f:
+    makeScopeWithSplicing' {
+      inherit splicePackages newScope otherSplices keep extra f;
+    };
+
   /* Like the above, but aims to support cross compilation. It's still ugly, but
      hopefully it helps a little bit. */
-  makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: extra: f:
+  makeScopeWithSplicing' =
+    { splicePackages
+    , newScope
+    }:
+    { otherSplices
+    , keep ? (_self: {})
+    , extra ? (_spliced0: {})
+    , f
+    }:
     let
       spliced0 = splicePackages {
         pkgsBuildBuild = otherSplices.selfBuildBuild;
@@ -295,13 +310,11 @@ rec {
         callPackage = newScope spliced; # == self.newScope {};
         # N.B. the other stages of the package set spliced in are *not*
         # overridden.
-        overrideScope = g: makeScopeWithSplicing
-          splicePackages
-          newScope
-          otherSplices
-          keep
-          extra
-          (lib.fixedPoints.extends g f);
+        overrideScope = g: (makeScopeWithSplicing'
+          { inherit splicePackages newScope; }
+          { inherit otherSplices keep extra;
+            f = lib.fixedPoints.extends g f;
+          });
         packages = f;
       };
     in self;