base/networking: fix open wifi connections + add helper functions

This commit is contained in:
Aly Raffauf 2024-06-29 15:20:19 -04:00
parent c17805f61a
commit d1c263b236

View file

@ -15,83 +15,60 @@
ensureProfiles = {
environmentFiles = [config.age.secrets.wifi.path];
profiles = {
"Dustin's A54" = {
profiles = let
mkOpenWiFi = ssid: {
connection = {
id = "Dustin's A54";
id = "${ssid}";
type = "wifi";
uuid = "fc221cbd-b6fd-44e0-8679-5998933b2fff";
};
ipv4 = {
method = "auto";
};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
wifi = {
mode = "infrastructure";
ssid = "${ssid}";
};
};
mkWPAWiFi = ssid: psk: {
connection = {
id = "${ssid}";
type = "wifi";
};
ipv4 = {
method = "auto";
};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
wifi = {
mode = "infrastructure";
ssid = "${ssid}";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$DustinsA54PSK";
psk = "${psk}";
};
wifi.ssid = "Dustin's A54";
};
javapatron = {
connection = {
id = "javapatron";
type = "wifi";
uuid = "bb61beaa-ec07-404c-bbce-5a08ae355de7";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
};
wifi.ssid = "javapatron";
};
"Taproom Public WiFi" = {
connection = {
id = "Taproom Public WiFi";
type = "wifi";
uuid = "d79280e9-4a22-4125-9583-eb7b80abfeb6";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
};
wifi.ssid = "Taproom Public WiFi";
};
Stargate-Discovery = {
connection = {
id = "Stargate-Discovery";
type = "wifi";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$StargateDiscoveryPSK";
};
wifi.ssid = "Stargate-Discovery";
};
wallace = {
connection = {
id = "wallace";
type = "wifi";
uuid = "6896b13d-9717-4a8d-8a08-2a97139bf833";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$wallacePSK";
};
wifi.ssid = "wallace";
};
in {
"Dustin's A54" = mkWPAWiFi "Dustin's A54" "$DustinsA54PSK";
"javapatron" = mkOpenWiFi "javapatron";
"Stargate-Discovery" = mkWPAWiFi "Stargate-Discovery" "$StargateDiscoveryPSK";
"Taproom Public WiFi" = mkOpenWiFi "Taproom Public WiFi";
"wallace" = mkWPAWiFi "wallace" "$wallacePSK";
WeWorkWiFi = {
"802-1x" = {