mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
lib.makeScopeWithSplicing: provide default for keep,extra
These are often unneeded by the user.
This commit is contained in:
parent
cb13669b00
commit
3716ef19d8
@ -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;
|
||||
|
@ -5,14 +5,8 @@
|
||||
, makeScopeWithSplicing
|
||||
}:
|
||||
|
||||
let
|
||||
keep = _self: { };
|
||||
extra = _spliced0: { };
|
||||
|
||||
in
|
||||
makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "xfce";
|
||||
inherit keep extra;
|
||||
f = (self:
|
||||
let
|
||||
inherit (self) callPackage;
|
||||
|
@ -39,15 +39,13 @@ let
|
||||
selfHostHost = luaOnHostForHost.pkgs;
|
||||
selfTargetTarget = luaOnTargetForTarget.pkgs or {};
|
||||
};
|
||||
keep = self: { };
|
||||
extra = spliced0: {};
|
||||
extensions = lib.composeManyExtensions [
|
||||
generatedPackages
|
||||
overriddenPackages
|
||||
overrides
|
||||
];
|
||||
in makeScopeWithSplicing {
|
||||
inherit otherSplices keep extra;
|
||||
inherit otherSplices;
|
||||
f = lib.extends extensions luaPackagesFun;
|
||||
})
|
||||
{
|
||||
|
@ -34,10 +34,8 @@ let
|
||||
selfHostHost = perlOnHostForHost.pkgs;
|
||||
selfTargetTarget = perlOnTargetForTarget.pkgs or {};
|
||||
};
|
||||
keep = self: { };
|
||||
extra = spliced0: {};
|
||||
in makeScopeWithSplicing {
|
||||
inherit otherSplices keep extra;
|
||||
inherit otherSplices;
|
||||
f = perlPackagesFun;
|
||||
})
|
||||
{
|
||||
|
@ -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;
|
||||
@ -61,7 +60,7 @@
|
||||
]);
|
||||
aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
|
||||
in makeScopeWithSplicing {
|
||||
inherit otherSplices keep extra;
|
||||
inherit otherSplices keep;
|
||||
f = lib.extends (lib.composeExtensions aliases extensions) keep;
|
||||
}) {
|
||||
overrides = packageOverrides;
|
||||
|
@ -336,7 +336,5 @@ let
|
||||
|
||||
in makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "qt5";
|
||||
keep = _: {};
|
||||
extra = _: {};
|
||||
f = addPackages;
|
||||
}
|
||||
|
@ -32,10 +32,7 @@ let
|
||||
|
||||
steamcmd = callPackage ./steamcmd.nix { };
|
||||
};
|
||||
keep = self: { };
|
||||
extra = spliced0: { };
|
||||
in makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "steamPackages";
|
||||
inherit keep extra;
|
||||
f = steamPackagesFun;
|
||||
}
|
||||
|
@ -68,8 +68,6 @@ let
|
||||
|
||||
in makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "freebsd";
|
||||
keep = _: {};
|
||||
extra = _: {};
|
||||
f = (self: let
|
||||
inherit (self) mkDerivation;
|
||||
in {
|
||||
|
@ -28,8 +28,6 @@ let
|
||||
|
||||
in makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "netbsd";
|
||||
keep = _: {};
|
||||
extra = _: {};
|
||||
f = (self: let
|
||||
inherit (self) mkDerivation;
|
||||
in {
|
||||
|
@ -27215,9 +27215,6 @@ with pkgs;
|
||||
};
|
||||
|
||||
xorg = let
|
||||
keep = _self: { };
|
||||
extra = _spliced0: { };
|
||||
|
||||
# Use `lib.callPackageWith __splicedPackages` rather than plain `callPackage`
|
||||
# so as not to have the newly bound xorg items already in scope, which would
|
||||
# have created a cycle.
|
||||
@ -27234,7 +27231,6 @@ with pkgs;
|
||||
|
||||
xorgPackages = makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "xorg";
|
||||
inherit keep extra;
|
||||
f = lib.extends overrides generatedPackages;
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,6 @@ in
|
||||
|
||||
makeScopeWithSplicing {
|
||||
otherSplices = generateSplicesForMkScope "darwin";
|
||||
keep = _: {};
|
||||
extra = spliced: spliced.apple_sdk.frameworks;
|
||||
f = (self: let
|
||||
inherit (self) mkDerivation callPackage;
|
||||
|
Loading…
Reference in New Issue
Block a user