summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-11-29 15:43:36 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-11-29 15:45:59 +0000
commit358d62868d9270c724c5bc342cda81e45fbac8c2 (patch)
treea31eab9f00257690ef900af042ed3d422c5bb830
parentcached-nix-shell: 0.1.3 -> 0.1.4 (#94567) (diff)
downloadnixpkgs-origin/wip/splice-more.tar.gz
WIP: treewide: splice more nested package setsorigin/wip/splice-more
So far this just has some functions that might come in handy. Next step is to find package sets that provide things used as non-buildInputs (most of them seem to not fit that?). I've always hated this splicing monster. Maybe others can tell me where this might be worth it. CC @FRidh @globin
-rw-r--r--lib/customisation.nix1
-rw-r--r--pkgs/development/interpreters/python/default.nix4
-rw-r--r--pkgs/top-level/splice.nix11
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 37a7951896b0..ae507807b4d9 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -231,6 +231,7 @@ rec {
} // keep self;
self = f self // {
newScope = scope: newScope (spliced // scope);
+ makeScopeWithSplicing = makeScopeWithSplicing splicePackages self.newScope;
callPackage = newScope spliced; # == self.newScope {};
# N.B. the other stages of the package set spliced in are *not*
# overridden.
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index 2f350738238e..e8043325c2f0 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -69,9 +69,7 @@ with pkgs;
recursivePthLoader
;
};
- in lib.makeScopeWithSplicing
- pkgs.splicePackages
- pkgs.newScope
+ in pkgs.makeScopeWithSplicing
otherSplices
keep
(lib.extends overrides pythonPackagesFun))
diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix
index a093442d3698..fb3c5d531705 100644
--- a/pkgs/top-level/splice.nix
+++ b/pkgs/top-level/splice.nix
@@ -131,6 +131,17 @@ in
newScope = extra: lib.callPackageWith (splicedPackagesWithXorg // extra);
+ makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
+
+ topProjectedSpliced = attr: {
+ selfBuildBuild = pkgs.pkgsBuildBuild.${attr};
+ selfBuildHost = pkgs.pkgsBuildHost.${attr};
+ selfBuildTarget = pkgs.pkgsBuildTarget.${attr};
+ selfHostHost = pkgs.pkgsHostHost.${attr};
+ selfHostTarget = pkgs.pkgsHostTarget.${attr};
+ selfTargetTarget = pkgs.pkgsTargetTarget.${attr} or {};
+ };
+
# Haskell package sets need this because they reimplement their own
# `newScope`.
__splicedPackages = splicedPackages // { recurseForDerivations = false; };