diff --git a/roles/desktop/services/networkmanager.nix b/roles/desktop/services/networkmanager.nix index d56c81b..acf5834 100644 --- a/roles/desktop/services/networkmanager.nix +++ b/roles/desktop/services/networkmanager.nix @@ -1,11 +1,55 @@ -{config, ...}: let +{ + config, + flakeSelf, + ... +}: let tailscaleName = config.services.tailscale.interfaceName; in { + age.secrets = { + wifiPasswords.file = "${flakeSelf.inputs.secrets}/wifi-passwords.age"; + }; networking.networkmanager = { enable = true; unmanaged = [ "interface-name:${tailscaleName}" ]; wifi.macAddress = "random"; + ensureProfiles = { + environmentFiles = [config.age.secrets.wifiPasswords.path]; + profiles = { + "4g-modem" = { + connection = { + id = "4G Modem"; + type = "wifi"; + }; + ipv4.method = "auto"; + wifi = { + mode = "infrastructure"; + ssid = "TP-Link_CCB4"; + }; + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-psk"; + psk = "$MODEM"; + }; + }; + phone = { + connection = { + id = "Phone"; + type = "wifi"; + }; + ipv4.method = "auto"; + wifi = { + mode = "infrastructure"; + ssid = "Redmi Note 10 Pro_5197"; + }; + wifi-security = { + auth-alg = "open"; + key-mgmt = "sae"; + psk = "$PHONE"; + }; + }; + }; + }; }; }