nixos/nixpkgs/read-only: fix cross‐compilation

This matches the definition of `_module.args.pkgs` in the standard
Nixpkgs module, and fixes a bunch of build issues caused by use of
`nativeBuildInputs = [ pkgs.foo ];` throughout NixOS.

A fallback could be added in case we expect people might be passing
in package sets without `__splicedPackages`, although that seems like
it would be inherently broken to me.
This commit is contained in:
Emily 2025-06-12 23:10:07 +01:00
parent cfcdbad637
commit 196f6a812b

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;
cfg.pkgs.__splicedPackages;
nixpkgs.config = cfg.pkgs.config;
nixpkgs.overlays = cfg.pkgs.overlays;
nixpkgs.hostPlatform = cfg.pkgs.stdenv.hostPlatform;