diff options
author | Artturi <Artturin@artturin.com> | 2023-08-20 18:57:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-20 18:57:05 +0300 |
commit | bde196dde968e4bf591599beb92e135f1f178d14 (patch) | |
tree | 42abb653f9ae3cea550e71ce8b05fd1bc5441502 /lib | |
parent | 7267429af3c93040dac1a22ceb5b2c4060d7b2ce (diff) | |
parent | cbc8aa437c44c510b54c664364dbfbcd98ac5f18 (diff) |
Merge pull request #245957 from amjoseph-nixpkgs/pr/lib/customization/makeScopeWithSplicing2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/customisation.nix | 29 | ||||
-rw-r--r-- | lib/default.nix | 2 |
2 files changed, 22 insertions, 9 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix index e13320076025c..c74708fbe4e27 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 124528c5f50c3..136f4a4a4637c 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 |