Desktop/NetworkManager: add wifi networks

This commit is contained in:
Toast 2024-04-14 17:24:39 +02:00
parent 5f776ae552
commit 5926168b3f

View file

@ -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";
};
};
};
};
};
}