Open edrex opened 3 years ago
Yes, it makes sense to add an assertion for this case. I should be able to add this, either to hostapd or the wpa_supplicant module.
I've learned that there's some nuance here: it may be desirable to have wpa_supplicant installed but not enabled at startup to allow switching between AP and station mode without rebuilding, like this. So maybe the assertion would just be a hinderance?
My idea was to check if services.hostapd.interface
is in wireless.interfaces
, so it would still allows you to run both hostapd and wpa_supplicant on different interfaces. If you want to switch between the two on a single interface, I'm not sure. Maybe just issue a warning?
iwd conflicts with wpa_supplicant: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/iwd.nix#L34-L39
I marked this as stale due to inactivity. → More info
enabling services.wireless and services.hostapd at the same time causes them to fight over the device, predictably.
Maybe the modules could throw an error if they're both enabled for the same device?
It seems wpa_supplicant scans for all wireless interfaces by default so the device isn't explicit in the config, but then I guess hostapd on any interface should conflict.
I'm pretty new to nix - if this doesn't make any sense let me know :)