From ec9377d809074e355d79276c25be4e885d330947 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Mon, 26 Aug 2024 18:14:35 +0400 Subject: [PATCH] Only add the new udev rule for x86 targets. The fundamental issue is that there is not a hardware.definitions defined for the non-x86 targets yet. so there is nothing in the config to evaluate and iterate the pcidevices. This is a tmp fix. Signed-off-by: Brian McGillion --- modules/microvm/virtualization/microvm/netvm.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/microvm/virtualization/microvm/netvm.nix b/modules/microvm/virtualization/microvm/netvm.nix index 4a11faa31..e356b48d5 100644 --- a/modules/microvm/virtualization/microvm/netvm.nix +++ b/modules/microvm/virtualization/microvm/netvm.nix @@ -85,8 +85,11 @@ let services.openssh = config.ghaf.security.sshKeys.sshAuthorizedKeysCommand; - # WORKAROUND: Create a rule to temporary hardcode device name for Wi-Fi adapter - services.udev.extraRules = '' + # WORKAROUND: Create a rule to temporary hardcode device name for Wi-Fi adapter on x86 + # TODO this is a dirty hack to guard against adding this to Nvidia/vm targets which + # dont have that definition structure yet defined. FIXME. + # TODO the hardware.definition should not even be exposed in targets that do not consume it + services.udev.extraRules = lib.mkIf (config.ghaf.hardware.definition.network.pciDevices != [ ]) '' SUBSYSTEM=="net", ACTION=="add", ATTRS{vendor}=="0x${(lib.head config.ghaf.hardware.definition.network.pciDevices).vendorId}", ATTRS{device}=="0x${(lib.head config.ghaf.hardware.definition.network.pciDevices).productId}", NAME="${(lib.head config.ghaf.hardware.definition.network.pciDevices).name}" '';