diff --git a/lib/customisation.nix b/lib/customisation.nix index a9281b1ab698..6dbe8f472f9b 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; diff --git a/lib/default.nix b/lib/default.nix index 73b8ad871544..1958d93aaf51 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 diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix index 51fd6f420e80..9ac0fe2200f9 100644 --- a/pkgs/top-level/splice.nix +++ b/pkgs/top-level/splice.nix @@ -145,6 +145,7 @@ in # prefill 2 fields of the function for convenience makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope; + makeScopeWithSplicing' = lib.makeScopeWithSplicing' { inherit splicePackages; inherit (pkgs) newScope; }; # generate 'otherSplices' for 'makeScopeWithSplicing' generateSplicesForMkScope = attr: