Skip to content

Commit

Permalink
WIP: treewide: splice more nested package sets
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ericson2314 committed Nov 29, 2020
1 parent 2868e69 commit 358d628
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/customisation.nix
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/interpreters/python/default.nix
Expand Up @@ -69,9 +69,7 @@ with pkgs;
recursivePthLoader
;
};
in lib.makeScopeWithSplicing
pkgs.splicePackages
pkgs.newScope
in pkgs.makeScopeWithSplicing
otherSplices
keep
(lib.extends overrides pythonPackagesFun))
Expand Down
11 changes: 11 additions & 0 deletions pkgs/top-level/splice.nix
Expand Up @@ -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; };
Expand Down

0 comments on commit 358d628

Please sign in to comment.