diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2017-01-15 18:03:59 -0500 |
---|---|---|
committer | John Ericson <Ericson2314@Yahoo.com> | 2017-01-24 11:37:56 -0500 |
commit | bfb147b6a8c4a3ddc581aab0b8a29b418db3b7a6 (patch) | |
tree | 54ccd6f0c81711c847da2da8798802edd31c3dad /pkgs/top-level/splice.nix | |
parent | 4c17cd555f6443207144da9af6e1c2b1304afd8b (diff) |
top-level: Only splice as needed for performance
Diffstat (limited to 'pkgs/top-level/splice.nix')
-rw-r--r-- | pkgs/top-level/splice.nix | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix index f57f42020c27..7afbd956d5bb 100644 --- a/pkgs/top-level/splice.nix +++ b/pkgs/top-level/splice.nix @@ -17,7 +17,11 @@ # `mkDerivation` knows how to pull out the right ones for `buildDepends` and # friends, but a few packages use them directly, so it seemed efficient (to # @Ericson2314) to reuse those names, at least initially, to minimize breakage. -lib: pkgs: +# +# For performance reasons, rather than uniformally splice in all cases, we only +# do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice` +# parameter there the boolean value of that equality check. +lib: pkgs: actuallySplice: let defaultBuildScope = pkgs.buildPackages // pkgs.buildPackages.xorg; @@ -58,7 +62,10 @@ let }; in lib.listToAttrs (map merge (lib.attrNames mash)); - splicedPackages = splicer defaultBuildScope defaultRunScope; + splicedPackages = + if actuallySplice + then splicer defaultBuildScope defaultRunScope + else pkgs // pkgs.xorg; in |