diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix index 66e624985dc4..3b600c22f60e 100644 --- a/pkgs/top-level/splice.nix +++ b/pkgs/top-level/splice.nix @@ -128,6 +128,15 @@ let "packages" ]; + packagesWithXorg = pkgs // builtins.removeAttrs pkgs.xorg [ + "callPackage" + "newScope" + "overrideScope" + "packages" + ]; + + pkgsForCall = if actuallySplice then splicedPackagesWithXorg else packagesWithXorg; + in { @@ -138,9 +147,9 @@ in # `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below). 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 makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope; @@ -169,5 +178,5 @@ in # Haskell package sets need this because they reimplement their own # `newScope`. - __splicedPackages = splicedPackages // { recurseForDerivations = false; }; + __splicedPackages = if actuallySplice then splicedPackages // { recurseForDerivations = false; } else pkgs; }