nixos/facter: fix conflict with readOnlyPkgs (#456076)

This commit is contained in:
Jörg Thalheim
2025-11-04 18:14:46 +00:00
committed by GitHub

View File

@@ -5,11 +5,11 @@
... ...
}: }:
{ {
# Skip setting hostPlatform in test VMs where it's read-only # Skip setting hostPlatform if it's read-only
# Tests have virtualisation.test options and import read-only.nix nixpkgs =
config.nixpkgs = lib.optionalAttrs (!(options ? virtualisation.test)) { lib.optionalAttrs
hostPlatform = lib.mkIf ( (config.hardware.facter.report.system or null != null && !options.nixpkgs.hostPlatform.readOnly)
config.hardware.facter.report.system or null != null && !options.nixpkgs.pkgs.isDefined {
) (lib.mkDefault config.hardware.facter.report.system); hostPlatform = lib.mkDefault config.hardware.facter.report.system;
}; };
} }