From c0ec57ef2290fea20ff287b94f3154a63b79687e Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Sat, 7 Sep 2024 21:14:16 +0200 Subject: [PATCH] fix(ap01): bridge only once the WLAN is in operational state It required a lot of technology, but hey, we now have it. Signed-off-by: Ryan Lahfa --- machines/ap01/_configuration.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/machines/ap01/_configuration.nix b/machines/ap01/_configuration.nix index a098d1c..37fed3a 100644 --- a/machines/ap01/_configuration.nix +++ b/machines/ap01/_configuration.nix @@ -124,7 +124,7 @@ rec { wlan1 = { member = config.hardware.networkInterfaces.wlan1; # Bridge only once hostapd is ready. - dependencies = [ config.services.hostap-2 ]; + dependencies = [ config.services.hostap-2-ready ]; }; }; }; @@ -205,6 +205,10 @@ rec { services.hostap-2 = mkWifiSta ( baseParams // clientRadius // externalRadius // radiusKeyMgmt // modernParams ) config.hardware.networkInterfaces.wlan1 secrets-2; + # Oneshot that waits until the hostapd has set the interface in operational state. + services.hostap-2-ready = svc.hostapd-ready.build { + interface = config.hardware.networkInterfaces.wlan1; + }; defaultProfile.packages = with pkgs; [ zyxel-bootconfig