From 74157fbdc2cb0ec4d9408350679a70695e08403d Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 30 Jun 2024 22:52:23 -0400 Subject: [PATCH] add new wifi connection + simplify helpers --- nixosModules/base/networking/default.nix | 76 ++++++++--------------- secrets/wifi.age | Bin 1386 -> 1436 bytes 2 files changed, 26 insertions(+), 50 deletions(-) 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 d8a7ef8d8ab78222d54e8829838896afd28ce997..d80b34373c5ab49c959a5665634323cee5ba2ebf 100644 GIT binary patch literal 1436 zcmZY8+pF6I90%|N%7*cZcwst68F(#SdP|z(nC9A(rnfXr(niMCq`9ZLG)dDGLw}CslF(+>N;ENAFhzbt(eD)7~KYV}uzC&Hjsjf0f z{mAs(P2NNYrv)IlB@>25P8}5?s8G$!Xm!wHGiYiHGf?HCnE_KeJ~tPkkvd`NPA87R zIH3)w8OgjKk~#w5BXbNT6y$SGUhTDDkFMBG-_eD*Wf@fj_A1msk_I}Mw^wU=cIfx@ zOwI0s*?=4=-Kt&eF*ABP_&jMX*Os?URAO<&zjoQI&0Wct%? zPvRWWGtGqIry9t2`eV}VhfR;GBONy>@^0YvVXYeia9a%AA|aJ=N*vj|kBL%hqIKWN zmpYtUSDjLn#z^c5W^=Vxn>e(LW;&A8kVTh-L2m*Ut%20wEM>$E=^k0~l`IuY`79E2 zeYh3^dW%My+@P(r8=(eUF-s|&&6SmSY7jjq6xa?IFggTIKyS6i^;oEjW?0lMm?`PZ zbt9=ad|TF#ieV^WG=_sVl13sT;a1(s@^chm^g&`wF~VuPO0QJ~D^0M)sBRA|c@#X$ zV@hw}l_1{%op80LR7g-~GrZ#}Ln6dNI~j$we66aE{gyB^?dBMqm7-#s;JHGA+Zd4t zB6B25&1Q*?i7u6L;h-j9*-niPlSP+C1yz&BV>2a+_1;aF6d`38=ox|0T16)ASRIap zOAzjup{=M0r&Wg#r^I5{)k1@a*xD=H&n9;>rF!xvuPF==EQj950?bw|n)d7;v zk1R!+EBxwig>k=JPBNBNnda{}S3gfi>U$)Gh05zMrPEh&o!JunbaAkgJF z-}a0NUnUdTz{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