From 568495bec2cbcb57bb2805983aa941997a31736d Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 25 Oct 2025 11:59:38 +0200 Subject: [PATCH 1/6] all-packages.nix: remove unused headers --- pkgs/top-level/all-packages.nix | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8bd88d03adfb..bf6fce27ce61 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8865,8 +8865,6 @@ with pkgs; ); agda = agdaPackages.agda; - ### DEVELOPMENT / LIBRARIES / BASH - ### DEVELOPMENT / LIBRARIES / JAVA saxonb = saxonb_8_8; @@ -9867,8 +9865,6 @@ with pkgs; zabbix = zabbix60; - ### SERVERS / GEOSPATIAL - ### OS-SPECIFIC alfred = callPackage ../os-specific/linux/batman-adv/alfred.nix { }; @@ -13614,10 +13610,6 @@ with pkgs; libxc = pkgs.libxc_7; }; - ### SCIENCE/GEOMETRY - - ### SCIENCE/BENCHMARK - ### SCIENCE/BIOLOGY cd-hit = callPackage ../applications/science/biology/cd-hit { @@ -13764,8 +13756,6 @@ with pkgs; } ); - ### SCIENCE/MEDICINE - ### SCIENCE/PHYSICS mcfm = callPackage ../applications/science/physics/MCFM { @@ -13778,8 +13768,6 @@ with pkgs; xflr5 = libsForQt5.callPackage ../applications/science/physics/xflr5 { }; - ### SCIENCE/PROGRAMMING - ### SCIENCE/LOGIC abella = callPackage ../applications/science/logic/abella { @@ -13918,8 +13906,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"; }; From 4949737a386f5d88d3525807384f87a5e3a26772 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 28 Oct 2025 15:21:49 +0100 Subject: [PATCH 2/6] systems/examples: remove x86_64-unknown-redox relibc itself has been removed in 2024 already. --- lib/systems/examples.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 47c3cf0c9558..d05c05910523 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -302,15 +302,6 @@ rec { libc = "newlib"; }; - # - # Redox - # - - x86_64-unknown-redox = { - config = "x86_64-unknown-redox"; - libc = "relibc"; - }; - # # Darwin # From 1d4ca026bcc5f191527c21ff90e3fcf913fe70b4 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 28 Oct 2025 15:22:36 +0100 Subject: [PATCH 3/6] uclibc: bring back alias This was removed recently when cleaning up aliases, but it breaks `pkgsCross.ben_nanonote`. --- pkgs/top-level/aliases.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b4128ecc1422..22a2b2447996 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -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 @@ -1507,7 +1508,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 From 2494e3664feeb1ff80dcc50e2ebb5a31e5a95609 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 17 Oct 2024 19:08:19 +0300 Subject: [PATCH 4/6] splice.nix: make `pkgs` `splicedPackages` when required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will make `pkgs` used in `callPackage`, and `pkgsCross.X.pkgs` have packages with `__spliced`. https://www.github.com/NixOS/nixpkgs/blob/3029741718f4c765fbc5ebf76bea3d6c8ff15fe5/pkgs/development/interpreters/python/passthrufun.nix#L37 https://www.github.com/NixOS/nixpkgs/blob/d2bd9a39dec88eddd5c192abee69939e67f43d12/pkgs/top-level/python-packages.nix#L10720 ``` nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced error: … while evaluating the attribute 'aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced' at /home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/development/python-modules/protobuf/4.nix:119:13: 118| passthru = { 119| inherit protobuf; | ^ 120| }; error: attribute '__spliced' missing at «string»:1:1: 1| pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced | ^ ``` to ``` nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced { buildBuild = «derivation /nix/store/s7da5mfvx4h1n86j78knaj9cprglxqz6-protobuf-25.4.drv»; buildHost = «derivation /nix/store/s7da5mfvx4h1n86j78knaj9cprglxqz6-protobuf-25.4.drv»; buildTarget = «repeated»; hostHost = «derivation /nix/store/mszvybzs4zxh43awyrjnybsfcb265n9r-protobuf-aarch64-unknown-linux-gnu-25.4.drv»; hostTarget = «repeated»; } ``` Co-authored-by: Wolfgang Walther --- pkgs/development/compilers/gcc/all.nix | 4 +++- pkgs/os-specific/windows/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/splice.nix | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/gcc/all.nix b/pkgs/development/compilers/gcc/all.nix index 1aba286411bd..8deba6c6f07c 100644 --- a/pkgs/development/compilers/gcc/all.nix +++ b/pkgs/development/compilers/gcc/all.nix @@ -2,6 +2,8 @@ lib, stdenv, pkgs, + overrideCC, + buildPackages, targetPackages, callPackage, isl_0_20, @@ -62,7 +64,7 @@ let ) && stdenv.cc.isGNU then - pkgs."gcc${majorVersion}Stdenv" + overrideCC stdenv buildPackages."gcc${majorVersion}" else stdenv; } diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix index 137a948960b7..e0f7e5b5f79e 100644 --- a/pkgs/os-specific/windows/default.nix +++ b/pkgs/os-specific/windows/default.nix @@ -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; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bf6fce27ce61..7cfde09d7f0e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6320,7 +6320,7 @@ with pkgs; null; bintoolsNoLibc = wrapBintoolsWith { bintools = bintools-unwrapped; - libc = targetPackages.preLibcHeaders; + libc = targetPackages.preLibcHeaders or preLibcHeaders; }; bintools = wrapBintoolsWith { bintools = bintools-unwrapped; diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix index fe4566bb175e..afbf3b12991a 100644 --- a/pkgs/top-level/splice.nix +++ b/pkgs/top-level/splice.nix @@ -173,6 +173,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' { From 1f74d7a2bd47813ccae4ebc1f36176986d9a86d4 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 1 Nov 2024 20:21:38 +0200 Subject: [PATCH 5/6] treewide: remove `= __splicedPackages` Now that `pkgs` is `__splicedPackages` on cross we can remove these variables I set. Assignments like `patchutils = pkgs.patchutils_0_3_3;` in `all-packages.nix` cannot be removed because the `pkgs` in `patchutils = pkgs.patchutils_0_3_3;` in `all-packages.nix` is coming from this `pkgs:` https://www.github.com/NixOS/nixpkgs/blob/b6e486730fc875ec79a3dea0f1f46eaf9f6ffa9d/pkgs/top-level/all-packages.nix#L9 instead of the `pkgs` in `with pkgs;` --- pkgs/development/beam-modules/default.nix | 3 +-- pkgs/development/interpreters/perl/default.nix | 6 +----- pkgs/top-level/all-packages.nix | 11 ++--------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix index 15ddc31e9347..b2c6e263134a 100644 --- a/pkgs/development/beam-modules/default.nix +++ b/pkgs/development/beam-modules/default.nix @@ -1,11 +1,10 @@ { lib, - __splicedPackages, + pkgs, erlang, }: let - pkgs = __splicedPackages; inherit (lib) makeExtensible; # FIXME: add support for overrideScope diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index b0f3480c01ac..69d02530a90f 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -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; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7cfde09d7f0e..0625c500cb1c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4089,11 +4089,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; @@ -4311,9 +4307,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 @@ -5015,7 +5009,6 @@ with pkgs; idrisPackages = recurseIntoAttrs ( callPackage ../development/idris-modules { idris-no-deps = haskellPackages.idris; - pkgs = pkgs.__splicedPackages; } ); From f2640ee208003ca7102cbda97740b07871fa7635 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 25 Oct 2025 22:07:04 +0200 Subject: [PATCH 6/6] top-level: return __splicedPackages --- nixos/lib/testing/driver.nix | 2 +- nixos/modules/misc/nixpkgs.nix | 2 +- nixos/modules/misc/nixpkgs/read-only.nix | 2 +- pkgs/stdenv/booter.nix | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index 6abfac7b3191..9eb7f8b7e3e8 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -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; diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 07845a4ece8e..12b4a6453449 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -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 = diff --git a/nixos/modules/misc/nixpkgs/read-only.nix b/nixos/modules/misc/nixpkgs/read-only.nix index db43615c12f0..fa372d13e545 100644 --- a/nixos/modules/misc/nixpkgs/read-only.nix +++ b/nixos/modules/misc/nixpkgs/read-only.nix @@ -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; diff --git a/pkgs/stdenv/booter.nix b/pkgs/stdenv/booter.nix index 1954e861eae1..934e7b87d14d 100644 --- a/pkgs/stdenv/booter.nix +++ b/pkgs/stdenv/booter.nix @@ -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