summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2023-08-20 18:57:05 +0300
committerGitHub <noreply@github.com>2023-08-20 18:57:05 +0300
commitbde196dde968e4bf591599beb92e135f1f178d14 (patch)
tree42abb653f9ae3cea550e71ce8b05fd1bc5441502 /lib
parent7267429af3c93040dac1a22ceb5b2c4060d7b2ce (diff)
parentcbc8aa437c44c510b54c664364dbfbcd98ac5f18 (diff)
downloadnixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.tar
nixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.tar.gz
nixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.tar.bz2
nixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.tar.lz
nixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.tar.xz
nixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.tar.zst
nixpkgs-bde196dde968e4bf591599beb92e135f1f178d14.zip
Merge pull request #245957 from amjoseph-nixpkgs/pr/lib/customization/makeScopeWithSplicing2
Diffstat (limited to 'lib')
-rw-r--r--lib/customisation.nix29
-rw-r--r--lib/default.nix2
2 files changed, 22 insertions, 9 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index e1332007602..c74708fbe4e 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -278,9 +278,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;
@@ -296,13 +311,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;
diff --git a/lib/default.nix b/lib/default.nix
index 124528c5f50..136f4a4a463 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -112,7 +112,7 @@ let
       noDepEntry fullDepEntry packEntry stringAfter;
     inherit (self.customisation) overrideDerivation makeOverridable
       callPackageWith callPackagesWith extendDerivation hydraJob
-      makeScope makeScopeWithSplicing;
+      makeScope makeScopeWithSplicing makeScopeWithSplicing';
     inherit (self.derivations) lazyDerivation;
     inherit (self.meta) addMetaAttrs dontDistribute setName updateName
       appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio