mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
splice.nix: improve performance with early cut-off (#350295)
This commit is contained in:
commit
6977b4cdab
@ -128,6 +128,15 @@ let
|
|||||||
"packages"
|
"packages"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
packagesWithXorg = pkgs // builtins.removeAttrs pkgs.xorg [
|
||||||
|
"callPackage"
|
||||||
|
"newScope"
|
||||||
|
"overrideScope"
|
||||||
|
"packages"
|
||||||
|
];
|
||||||
|
|
||||||
|
pkgsForCall = if actuallySplice then splicedPackagesWithXorg else packagesWithXorg;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -138,9 +147,9 @@ in
|
|||||||
# `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below).
|
# `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below).
|
||||||
callPackage = pkgs.newScope { };
|
callPackage = pkgs.newScope { };
|
||||||
|
|
||||||
callPackages = lib.callPackagesWith splicedPackagesWithXorg;
|
callPackages = lib.callPackagesWith pkgsForCall;
|
||||||
|
|
||||||
newScope = extra: lib.callPackageWith (splicedPackagesWithXorg // extra);
|
newScope = extra: lib.callPackageWith (pkgsForCall // extra);
|
||||||
|
|
||||||
# prefill 2 fields of the function for convenience
|
# prefill 2 fields of the function for convenience
|
||||||
makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
|
makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
|
||||||
@ -169,5 +178,5 @@ in
|
|||||||
|
|
||||||
# Haskell package sets need this because they reimplement their own
|
# Haskell package sets need this because they reimplement their own
|
||||||
# `newScope`.
|
# `newScope`.
|
||||||
__splicedPackages = splicedPackages // { recurseForDerivations = false; };
|
__splicedPackages = if actuallySplice then splicedPackages // { recurseForDerivations = false; } else pkgs;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user