From a555914285e9d29a88c85763cbb507f0df71793c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 4 Nov 2025 19:26:31 +0100 Subject: [PATCH] nixos/facter: make hasCPUFeature more fault-tolerant Add default value for features attribute in hasCPUFeature function to handle CPU records that might not have a features field, preventing errors when the report structure varies. --- nixos/modules/hardware/facter/virtualisation.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/hardware/facter/virtualisation.nix b/nixos/modules/hardware/facter/virtualisation.nix index 9f418ecf3488..e1a9a1647708 100644 --- a/nixos/modules/hardware/facter/virtualisation.nix +++ b/nixos/modules/hardware/facter/virtualisation.nix @@ -57,7 +57,14 @@ in boot.kernelModules = let hasCPUFeature = - feature: lib.any ({ features, ... }: lib.elem feature features) (report.hardware.cpu or [ ]); + feature: + lib.any ( + { + features ? [ ], + ... + }: + lib.elem feature features + ) (report.hardware.cpu or [ ]); in lib.mkMerge [ (lib.mkIf (hasCPUFeature "vmx") [ "kvm-intel" ])