From 5dd595a209df9239790c39eedd91d09f8313bdd1 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 18 Mar 2024 19:52:37 +0000 Subject: [PATCH] configure hostapds in gateway profile --- examples/rotuer.nix | 48 +++++++++++++++--------------------- modules/profiles/gateway.nix | 2 +- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/examples/rotuer.nix b/examples/rotuer.nix index 6082657..1e30282 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -18,11 +18,6 @@ let wirelessConfig = { country_code = "GB"; inherit (secrets) wpa_passphrase; - auth_algs = 1; # 1=wpa2, 2=wep, 3=both - wpa = 2; # 1=wpa, 2=wpa2, 3=both - wpa_key_mgmt = "WPA-PSK"; - wpa_pairwise = "TKIP CCMP"; # auth for wpa (may not need this?) - rsn_pairwise = "CCMP"; # auth for wpa2 wmm_enabled = 1; }; @@ -57,29 +52,26 @@ in rec { family = "inet"; address ="${secrets.lan.prefix}.1"; prefixLength = 24; }; }; - }; - services.hostap = svc.hostapd.build { - interface = config.hardware.networkInterfaces.wlan; - params = { - ssid = secrets.ssid; - hw_mode="g"; - channel = "2"; - ieee80211n = 1; - } // wirelessConfig; - }; - - services.hostap5 = svc.hostapd.build { - interface = config.hardware.networkInterfaces.wlan5; - params = rec { - ssid = "${secrets.ssid}5"; - hw_mode="a"; - channel = 36; - ht_capab = "[HT40+]"; - vht_oper_chwidth = 1; - vht_oper_centr_freq_seg0_idx = channel + 6; - ieee80211n = 1; - ieee80211ac = 1; - } // wirelessConfig; + wireless.networks = { + telent = { + interface = config.hardware.networkInterfaces.wlan; + ssid = secrets.ssid; + hw_mode="g"; + channel = "2"; + ieee80211n = 1; + } // wirelessConfig; + telent5 = rec { + interface = config.hardware.networkInterfaces.wlan5; + ssid = "${secrets.ssid}5"; + hw_mode="a"; + channel = 36; + ht_capab = "[HT40+]"; + vht_oper_chwidth = 1; + vht_oper_centr_freq_seg0_idx = channel + 6; + ieee80211n = 1; + ieee80211ac = 1; + } // wirelessConfig; + }; }; services.ntp = svc.ntp.build { diff --git a/modules/profiles/gateway.nix b/modules/profiles/gateway.nix index f9fae4f..a67478b 100644 --- a/modules/profiles/gateway.nix +++ b/modules/profiles/gateway.nix @@ -52,7 +52,7 @@ in { ../bridge ../ntp ../ssh -# { config.services = hostaps; } + { config.services = hostaps; } ];