Reapply "splice.nix: make pkgs splicedPackages" (#456138)

This commit is contained in:
Philip Taron
2025-11-01 13:49:33 +00:00
committed by GitHub
12 changed files with 21 additions and 48 deletions

View File

@@ -302,15 +302,6 @@ rec {
libc = "newlib";
};
#
# Redox
#
x86_64-unknown-redox = {
config = "x86_64-unknown-redox";
libc = "relibc";
};
#
# Darwin
#

View File

@@ -202,7 +202,7 @@ in
_module.args = {
hostPkgs =
# Comment is in nixos/modules/misc/nixpkgs.nix
lib.mkOverride lib.modules.defaultOverridePriority config.hostPkgs.__splicedPackages;
lib.mkOverride lib.modules.defaultOverridePriority config.hostPkgs;
};
driver = withChecks driver;

View File

@@ -355,7 +355,7 @@ in
# which is somewhat costly for Nixpkgs. With an explicit priority, we only
# evaluate the wrapper to find out that the priority is lower, and then we
# don't need to evaluate `finalPkgs`.
lib.mkOverride lib.modules.defaultOverridePriority finalPkgs.__splicedPackages;
lib.mkOverride lib.modules.defaultOverridePriority finalPkgs;
};
assertions =

View File

@@ -63,7 +63,7 @@ in
# find mistaken definitions
builtins.seq cfg.config builtins.seq cfg.overlays builtins.seq cfg.hostPlatform builtins.seq
cfg.buildPlatform
cfg.pkgs.__splicedPackages;
cfg.pkgs;
nixpkgs.config = cfg.pkgs.config;
nixpkgs.overlays = cfg.pkgs.overlays;
nixpkgs.hostPlatform = cfg.pkgs.stdenv.hostPlatform;

View File

@@ -1,11 +1,10 @@
{
lib,
__splicedPackages,
pkgs,
erlang,
}:
let
pkgs = __splicedPackages;
inherit (lib) makeExtensible;
# FIXME: add support for overrideScope

View File

@@ -2,6 +2,8 @@
lib,
stdenv,
pkgs,
overrideCC,
buildPackages,
targetPackages,
callPackage,
isl_0_20,
@@ -61,7 +63,7 @@ let
)
&& stdenv.cc.isGNU
then
pkgs."gcc${majorVersion}Stdenv"
overrideCC stdenv buildPackages."gcc${majorVersion}"
else
stdenv;
}

View File

@@ -30,11 +30,7 @@ let
}:
let
perlPackagesFun = callPackage ../../../top-level/perl-packages.nix {
# allow 'perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig; }; }' like in python3Packages
# most perl packages aren't called with callPackage so it's not possible to override their arguments individually
# the conditional is because the // above won't be applied to __splicedPackages and hopefully no one is doing that when cross-compiling
pkgs = if stdenv.buildPlatform != stdenv.hostPlatform then pkgs.__splicedPackages else pkgs;
inherit stdenv;
inherit stdenv pkgs;
perl = self;
};

View File

@@ -27,11 +27,11 @@ lib.makeScope newScope (
else
buildPackages.gccWithoutTargetLibc.override (old: {
bintools = old.bintools.override {
libc = pkgs.libc;
libc = pkgs.pkgsHostTarget.libc;
noLibc = pkgs.libc == null;
nativeLibc = false;
};
libc = pkgs.libc;
libc = pkgs.pkgsHostTarget.libc;
noLibc = pkgs.libc == null;
nativeLibc = false;
})

View File

@@ -162,5 +162,9 @@ let
buildPackages.stdenv.cc;
};
pkgs = dfold folder postStage (_: { }) withAllowCustomOverrides;
in
dfold folder postStage (_: { }) withAllowCustomOverrides
# Return the spliced package set, so that consumers of the nixpkgs top-level
# attributes, like NixOS, don't break when cross-compiling.
pkgs.__splicedPackages

View File

@@ -254,6 +254,7 @@ mapAliases {
elasticsearch7Plugins = elasticsearchPlugins; # preserve, reason: until v8
fetchFromGithub = throw "You meant fetchFromGitHub, with a capital H"; # preserve, reason: common typo
fuse2fs = if stdenv.hostPlatform.isLinux then e2fsprogs.fuse2fs else null; # Added 2022-03-27 preserve, reason: convenience, arch has a package named fuse2fs too.
uclibc = uclibc-ng; # preserve, because uclibc-ng can't be used in config string
wlroots = wlroots_0_19; # preserve, reason: wlroots is unstable, we must keep depending on 'wlroots_0_*', convert to package after a stable(1.x) release
wormhole-rs = magic-wormhole-rs; # Added 2022-05-30. preserve, reason: Arch package name, main binary name
@@ -1520,7 +1521,6 @@ mapAliases {
uade123 = throw "'uade123' has been renamed to/replaced by 'uade'"; # Converted to throw 2025-10-27
uae = throw "'uae' has been removed due to lack of upstream maintenance. Consider using 'fsuae' instead."; # Added 2025-06-11
ubuntu_font_family = throw "'ubuntu_font_family' has been renamed to/replaced by 'ubuntu-classic'"; # Converted to throw 2025-10-27
uclibc = throw "'uclibc' has been renamed to/replaced by 'uclibc-ng'"; # Converted to throw 2025-10-27
unicap = throw "'unicap' has been removed because it is unmaintained"; # Added 2025-05-17
unifi-poller = throw "'unifi-poller' has been renamed to/replaced by 'unpoller'"; # Converted to throw 2025-10-27
unzoo = throw "'unzoo' has been removed since it is unmaintained upstream and doesn't compile with newer versions of GCC anymore"; # Removed 2025-05-24

View File

@@ -4064,11 +4064,7 @@ with pkgs;
tldr-hs = haskellPackages.tldr;
tmuxPlugins = recurseIntoAttrs (
callPackage ../misc/tmux-plugins {
pkgs = pkgs.__splicedPackages;
}
);
tmuxPlugins = recurseIntoAttrs (callPackage ../misc/tmux-plugins { });
tpm2-totp-with-plymouth = tpm2-totp.override {
withPlymouth = true;
@@ -4282,9 +4278,7 @@ with pkgs;
yarn-berry_4 = yarn-berry.override { berryVersion = 4; };
yarn-berry_3 = yarn-berry.override { berryVersion = 3; };
yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea {
pkgs = pkgs.__splicedPackages;
};
yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea { };
inherit (yarn2nix-moretea)
yarn2nix
@@ -4986,7 +4980,6 @@ with pkgs;
idrisPackages = recurseIntoAttrs (
callPackage ../development/idris-modules {
idris-no-deps = haskellPackages.idris;
pkgs = pkgs.__splicedPackages;
}
);
@@ -6289,7 +6282,7 @@ with pkgs;
null;
bintoolsNoLibc = wrapBintoolsWith {
bintools = bintools-unwrapped;
libc = targetPackages.preLibcHeaders;
libc = targetPackages.preLibcHeaders or preLibcHeaders;
};
bintools = wrapBintoolsWith {
bintools = bintools-unwrapped;
@@ -8834,8 +8827,6 @@ with pkgs;
);
agda = agdaPackages.agda;
### DEVELOPMENT / LIBRARIES / BASH
### DEVELOPMENT / LIBRARIES / JAVA
saxonb = saxonb_8_8;
@@ -9836,8 +9827,6 @@ with pkgs;
zabbix = zabbix60;
### SERVERS / GEOSPATIAL
### OS-SPECIFIC
alfred = callPackage ../os-specific/linux/batman-adv/alfred.nix { };
@@ -13507,10 +13496,6 @@ with pkgs;
libxc = pkgs.libxc_7;
};
### SCIENCE/GEOMETRY
### SCIENCE/BENCHMARK
### SCIENCE/BIOLOGY
cd-hit = callPackage ../applications/science/biology/cd-hit {
@@ -13659,8 +13644,6 @@ with pkgs;
}
);
### SCIENCE/MEDICINE
### SCIENCE/PHYSICS
mcfm = callPackage ../applications/science/physics/MCFM {
@@ -13673,8 +13656,6 @@ with pkgs;
xflr5 = libsForQt5.callPackage ../applications/science/physics/xflr5 { };
### SCIENCE/PROGRAMMING
### SCIENCE/LOGIC
abella = callPackage ../applications/science/logic/abella {
@@ -13813,8 +13794,6 @@ with pkgs;
inherit (ocaml-ng.ocamlPackages_4_14_unsafe_string) ocaml;
};
### SCIENCE / ENGINEERING
### SCIENCE / ELECTRONICS
simulide_0_4_15 = callPackage ../by-name/si/simulide/package.nix { versionNum = "0.4.15"; };

View File

@@ -140,6 +140,8 @@ in
newScope = extra: lib.callPackageWith (pkgsForCall // extra);
pkgs = if actuallySplice then splicedPackages // { recurseForDerivations = false; } else pkgs;
# prefill 2 fields of the function for convenience
makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
makeScopeWithSplicing' = lib.makeScopeWithSplicing' {