Switch declarative WiFi from wpa_supplicant to networkmanager.ensureProfiles
This commit is contained in:
parent
cc2c488ead
commit
91bc21b7dc
1 changed files with 34 additions and 39 deletions
|
@ -14,56 +14,51 @@ in
|
||||||
ViliMobile_PSK.sopsFile = ../../secrets/wireless.yaml;
|
ViliMobile_PSK.sopsFile = ../../secrets/wireless.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
templates."wpa_supplicant_secrets".content = ''
|
templates."nm_wifi_secrets.env".content = ''
|
||||||
WRT_Personal_PSK=${config.sops.placeholder.WRT_Personal_PSK}
|
WRT_Personal_PSK=${config.sops.placeholder.WRT_Personal_PSK}
|
||||||
WLNPub_PSK=${config.sops.placeholder.WLNPub_PSK}
|
WLNPub_PSK=${config.sops.placeholder.WLNPub_PSK}
|
||||||
ViliMobile_PSK=${config.sops.placeholder.ViliMobile_PSK}
|
ViliMobile_PSK=${config.sops.placeholder.ViliMobile_PSK}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.networkmanager.unmanaged = [ "except:type:wifi" ];
|
networking.networkmanager.ensureProfiles = {
|
||||||
|
environmentFiles = [ config.sops.templates."nm_wifi_secrets.env".path ];
|
||||||
networking.wireless = {
|
profiles = {
|
||||||
fallbackToWPA2 = false;
|
|
||||||
enable = true;
|
|
||||||
userControlled.enable = true;
|
|
||||||
secretsFile = config.sops.templates."wpa_supplicant_secrets".path;
|
|
||||||
extraConfig = ''
|
|
||||||
mac_addr=1
|
|
||||||
'';
|
|
||||||
networks = {
|
|
||||||
WRT_Personal = {
|
WRT_Personal = {
|
||||||
authProtocols = [ "SAE" ];
|
connection = {
|
||||||
pskRaw = "ext:WRT_Personal_PSK";
|
id = "WRT_Personal";
|
||||||
priority = 100;
|
type = "wifi";
|
||||||
extraConfig = ''
|
uuid = "d31db7fa-aa1f-479d-8410-675f7175406c";
|
||||||
ieee80211w=2
|
};
|
||||||
pairwise=CCMP
|
wifi.ssid = "WRT_Personal";
|
||||||
group=CCMP
|
wifi-security = {
|
||||||
mac_addr=0
|
key-mgmt = "sae";
|
||||||
'';
|
psk = "$WRT_Personal_PSK";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
WLNPub = {
|
WLNPub = {
|
||||||
# TODO Fix
|
connection = {
|
||||||
pskRaw = "ext:WLNPub_PSK";
|
id = "WLNPub";
|
||||||
priority = 100;
|
type = "wifi";
|
||||||
extraConfig = ''
|
uuid = "7cca6ccd-641b-41e0-a0d2-aaed77394267";
|
||||||
ieee80211w=2
|
};
|
||||||
pairwise=CCMP
|
wifi.ssid = "WLNPub";
|
||||||
group=CCMP
|
wifi-security = {
|
||||||
mac_addr=0
|
key-mgmt = "sae";
|
||||||
'';
|
psk = "$WLNPub_PSK";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
ViliMobile = {
|
ViliMobile = {
|
||||||
authProtocols = [ "SAE" ];
|
connection = {
|
||||||
pskRaw = "ext:ViliMobile_PSK";
|
id = "ViliMobile";
|
||||||
priority = 50;
|
type = "wifi";
|
||||||
extraConfig = ''
|
uuid = "0bba8429-5078-4da3-8af3-b27cc2b24b19";
|
||||||
ieee80211w=2
|
};
|
||||||
pairwise=CCMP
|
wifi.ssid = "ViliMobile";
|
||||||
group=CCMP
|
wifi-security = {
|
||||||
mac_addr=0
|
key-mgmt = "sae";
|
||||||
'';
|
psk = "$ViliMobile_PSK";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue