mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-23 08:03:56 -05:00
Aly Raffauf
015af48614
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-build / slateport-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run
60 lines
2.1 KiB
Nix
60 lines
2.1 KiB
Nix
{config, ...}: {
|
|
age.secrets.wifi.file = ../secrets/wifi.age;
|
|
|
|
networking.networkmanager = {
|
|
enable = true;
|
|
|
|
ensureProfiles = {
|
|
environmentFiles = [config.age.secrets.wifi.path];
|
|
profiles = let
|
|
mkOpenWiFi = ssid: {
|
|
connection.id = "${ssid}";
|
|
connection.type = "wifi";
|
|
ipv4.method = "auto";
|
|
ipv6.addr-gen-mode = "default";
|
|
ipv6.method = "auto";
|
|
wifi.mode = "infrastructure";
|
|
wifi.ssid = "${ssid}";
|
|
};
|
|
|
|
mkWPA2WiFi = ssid: psk: (
|
|
(mkOpenWiFi ssid)
|
|
// {
|
|
wifi-security.auth-alg = "open";
|
|
wifi-security.key-mgmt = "wpa-psk";
|
|
wifi-security.psk = "${psk}";
|
|
}
|
|
);
|
|
|
|
mkEAPWiFi = ssid: identity: pass: auth: (
|
|
(mkOpenWiFi ssid)
|
|
// {
|
|
"802-1x".eap = "peap;";
|
|
"802-1x".identity = "${identity}";
|
|
"802-1x".password = "${pass}";
|
|
"802-1x".phase2-auth = "${auth}";
|
|
wifi-security.auth-alg = "open";
|
|
wifi-security.key-mgmt = "wpa-eap";
|
|
}
|
|
);
|
|
in {
|
|
"Dustin's A54" = mkWPA2WiFi "Dustin's A54" "$DustinsA54PSK";
|
|
"East Pole Coffee Co." = mkWPA2WiFi "East Pole Coffee Co." "$EastPolePSK";
|
|
"InmanPerkCustomer" = mkWPA2WiFi "InmanPerkCustomer" "$InmanPerkCustomerPSK";
|
|
"javapatron" = mkOpenWiFi "javapatron";
|
|
"Muchacho Guest" = mkOpenWiFi "Muchacho Guest";
|
|
"Parkgrounds1" = mkWPA2WiFi "Parkgrounds1" "$Parkgrounds1PSK";
|
|
"PERC COFFEE 5 Guest" = mkWPA2WiFi "PERC COFFEE 5 Guest" "$PERCguestPSK";
|
|
"PERCguest" = mkWPA2WiFi "PERCguest" "$PERCguestPSK";
|
|
"Stargate-Discovery" = mkWPA2WiFi "Stargate-Discovery" "$StargateDiscoveryPSK";
|
|
"Taproom Public WiFi" = mkOpenWiFi "Taproom Public WiFi";
|
|
"VINATL-Guest" = mkWPA2WiFi "VINATL-Guest" "$VINATLGuestPSK";
|
|
"wallace" = mkWPA2WiFi "wallace" "$wallacePSK";
|
|
"WeWorkWiFi" = mkEAPWiFi "WeWorkWiFi" "$WeWorkWiFiIdentity" "$WeWorkWiFiPassword" "mschapv2";
|
|
};
|
|
};
|
|
|
|
wifi.powersave = true;
|
|
};
|
|
}
|