Unverified Commit 12cb207d authored by Adam Joseph's avatar Adam Joseph Committed by GitHub
Browse files

Merge pull request #245824 from amjoseph-nixpkgs/pr/lib/customization/makeScopeWithSplicing

lib.customisation: uncurry makeScopeWithSplicing
parents ac4cb90b 3716ef19
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -279,7 +279,15 @@ rec {

  /* 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 +303,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;
+5 −11
Original line number Diff line number Diff line
@@ -5,16 +5,9 @@
, makeScopeWithSplicing
}:

let
  keep = _self: { };
  extra = _spliced0: { };

in
makeScopeWithSplicing
  (generateSplicesForMkScope "xfce")
  keep
  extra
  (self:
makeScopeWithSplicing {
  otherSplices = generateSplicesForMkScope "xfce";
  f = (self:
    let
      inherit (self) callPackage;
    in
@@ -177,4 +170,5 @@ makeScopeWithSplicing
      thunar-bare = self.thunar.override { thunarPlugins = [ ]; }; # added 2019-11-04

      xfce4-hardware-monitor-plugin = throw "xfce.xfce4-hardware-monitor-plugin has been removed: abandoned by upstream and does not build"; # added 2023-01-15
    })
    });
}
+4 −7
Original line number Diff line number Diff line
@@ -39,18 +39,15 @@ let
            selfHostHost = luaOnHostForHost.pkgs;
            selfTargetTarget = luaOnTargetForTarget.pkgs or {};
          };
          keep = self: { };
          extra = spliced0: {};
          extensions = lib.composeManyExtensions [
            generatedPackages
            overriddenPackages
            overrides
          ];
        in makeScopeWithSplicing
          otherSplices
          keep
          extra
          (lib.extends extensions luaPackagesFun))
        in makeScopeWithSplicing {
          inherit otherSplices;
          f = lib.extends extensions luaPackagesFun;
        })
        {
          overrides = packageOverrides;
          lua = self;
+4 −7
Original line number Diff line number Diff line
@@ -34,13 +34,10 @@ let
            selfHostHost = perlOnHostForHost.pkgs;
            selfTargetTarget = perlOnTargetForTarget.pkgs or {};
          };
          keep = self: { };
          extra = spliced0: {};
        in makeScopeWithSplicing
          otherSplices
          keep
          extra
          perlPackagesFun)
        in makeScopeWithSplicing {
          inherit otherSplices;
          f = perlPackagesFun;
        })
        {
          perl = self;
        };
+4 −7
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
      };
      hooks = import ./hooks/default.nix;
      keep = lib.extends hooks pythonPackagesFun;
      extra = _: {};
      optionalExtensions = cond: as: lib.optionals cond as;
      pythonExtension = import ../../../top-level/python-packages.nix;
      python2Extension = import ../../../top-level/python2-packages.nix;
@@ -60,12 +59,10 @@
        overrides
      ]);
      aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
    in makeScopeWithSplicing
      otherSplices
      keep
      extra
      (lib.extends (lib.composeExtensions aliases extensions) keep))
    {
    in makeScopeWithSplicing {
      inherit otherSplices keep;
      f = lib.extends (lib.composeExtensions aliases extensions) keep;
    }) {
      overrides = packageOverrides;
      python = self;
    });
Loading