services.hostapd: convert iwd assertion ito an warning (#445760)
This commit is contained in:
@@ -1334,26 +1334,21 @@ in
|
|||||||
# we check if wirelessInterfaces is empty as that means all interfaces implicit
|
# we check if wirelessInterfaces is empty as that means all interfaces implicit
|
||||||
shouldWarn = wirelessEnabled && (wirelessInterfaces == [ ] || hasInterfaceConflict);
|
shouldWarn = wirelessEnabled && (wirelessInterfaces == [ ] || hasInterfaceConflict);
|
||||||
in
|
in
|
||||||
if shouldWarn then
|
lib.optional shouldWarn ''
|
||||||
[
|
|
||||||
''
|
|
||||||
Some wireless interface is configured for both for client and access point mode:
|
Some wireless interface is configured for both for client and access point mode:
|
||||||
this is not allowed. Either specify `networking.wireless.interfaces` and exclude
|
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`
|
those from `services.hostapd.radios` or make sure to not run the `wpa_supplicant`
|
||||||
and `hostapd` services simultaneously.
|
and `hostapd` services simultaneously.
|
||||||
''
|
''
|
||||||
]
|
++ lib.optional config.networking.wireless.iwd.enable ''
|
||||||
else
|
hostapd and iwd do conflict,
|
||||||
[ ];
|
use `networking.wireless.enable` in combination with `networking.wireless.interfaces` to avoid it.
|
||||||
|
'';
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = cfg.radios != { };
|
assertion = cfg.radios != { };
|
||||||
message = "At least one radio must be configured with hostapd!";
|
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
|
# Radio warnings
|
||||||
++ (concatLists (
|
++ (concatLists (
|
||||||
|
|||||||
Reference in New Issue
Block a user