diff --git a/nixosModules/base/networking/default.nix b/nixosModules/base/networking/default.nix index f9328aed..e914ba98 100644 --- a/nixosModules/base/networking/default.nix +++ b/nixosModules/base/networking/default.nix @@ -35,60 +35,36 @@ }; }; - mkWPAWiFi = ssid: psk: { - connection = { - id = "${ssid}"; - type = "wifi"; - }; + mkWPAWiFi = ssid: psk: ( + (mkOpenWiFi ssid) + // { + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-psk"; + psk = "${psk}"; + }; + } + ); - ipv4.method = "auto"; + mkEAPWiFi = ssid: identity: pass: auth: ( + (mkOpenWiFi ssid) + // { + "802-1x" = { + eap = "peap;"; + identity = "${identity}"; + password = "${pass}"; + phase2-auth = "${auth}"; + }; - ipv6 = { - addr-gen-mode = "default"; - method = "auto"; - }; - - wifi = { - mode = "infrastructure"; - ssid = "${ssid}"; - }; - - wifi-security = { - auth-alg = "open"; - key-mgmt = "wpa-psk"; - psk = "${psk}"; - }; - }; - - mkEAPWiFi = ssid: identity: pass: auth: { - "802-1x" = { - eap = "PEAP"; - identity = "${identity}"; - password = "${pass}"; - phase2-auth = "${auth}"; - }; - - connection = { - id = "${ssid}"; - type = "wifi"; - }; - - ipv4.method = "auto"; - - ipv6 = { - addr-gen-mode = "default"; - method = "auto"; - }; - - wifi = { - mode = "infrastructure"; - ssid = "${ssid}"; - }; - - wifi-security.key-mgmt = "wpa-eap"; - }; + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-eap"; + }; + } + ); in { "Dustin's A54" = mkWPAWiFi "Dustin's A54" "$DustinsA54PSK"; + "FCS-WiFi2" = mkEAPWiFi "FCS-WiFi2" "$FCSIdentity" "$FCSPassword" "mschapv2"; "javapatron" = mkOpenWiFi "javapatron"; "Stargate-Discovery" = mkWPAWiFi "Stargate-Discovery" "$StargateDiscoveryPSK"; "Taproom Public WiFi" = mkOpenWiFi "Taproom Public WiFi"; diff --git a/secrets/wifi.age b/secrets/wifi.age index d8a7ef8d..d80b3437 100644 Binary files a/secrets/wifi.age and b/secrets/wifi.age differ