From be8eb7a3ed40532ed6715f5496f3f688595722be Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 24 Sep 2025 12:31:17 +0200 Subject: [PATCH] services.hostapd: convert iwd assertion ito an warning --- nixos/modules/services/networking/hostapd.nix | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix index bdd016ef63cf..ef0094cf1aa7 100644 --- a/nixos/modules/services/networking/hostapd.nix +++ b/nixos/modules/services/networking/hostapd.nix @@ -1334,26 +1334,21 @@ in # we check if wirelessInterfaces is empty as that means all interfaces implicit shouldWarn = wirelessEnabled && (wirelessInterfaces == [ ] || hasInterfaceConflict); in - if shouldWarn then - [ - '' - Some wireless interface is configured for both for client and access point mode: - this is not allowed. Either specify `networking.wireless.interfaces` and exclude - those from `services.hostapd.radios` or make sure to not run the `wpa_supplicant` - and `hostapd` services simultaneously. - '' - ] - else - [ ]; + lib.optional shouldWarn '' + Some wireless interface is configured for both for client and access point mode: + this is not allowed. Either specify `networking.wireless.interfaces` and exclude + those from `services.hostapd.radios` or make sure to not run the `wpa_supplicant` + and `hostapd` services simultaneously. + '' + ++ lib.optional config.networking.wireless.iwd.enable '' + hostapd and iwd do conflict, + use `networking.wireless.enable` in combination with `networking.wireless.interfaces` to avoid it. + ''; assertions = [ { assertion = cfg.radios != { }; message = "At least one radio must be configured with hostapd!"; } - { - assertion = !config.networking.wireless.iwd.enable; - message = "hostapd and iwd conflict, use `networking.wireless.enable` in combination with `networking.wireless.interfaces`"; - } ] # Radio warnings ++ (concatLists (