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;
|
||||
};
|
||||
|
||||
templates."wpa_supplicant_secrets".content = ''
|
||||
templates."nm_wifi_secrets.env".content = ''
|
||||
WRT_Personal_PSK=${config.sops.placeholder.WRT_Personal_PSK}
|
||||
WLNPub_PSK=${config.sops.placeholder.WLNPub_PSK}
|
||||
ViliMobile_PSK=${config.sops.placeholder.ViliMobile_PSK}
|
||||
'';
|
||||
};
|
||||
|
||||
networking.networkmanager.unmanaged = [ "except:type:wifi" ];
|
||||
|
||||
networking.wireless = {
|
||||
fallbackToWPA2 = false;
|
||||
enable = true;
|
||||
userControlled.enable = true;
|
||||
secretsFile = config.sops.templates."wpa_supplicant_secrets".path;
|
||||
extraConfig = ''
|
||||
mac_addr=1
|
||||
'';
|
||||
networks = {
|
||||
networking.networkmanager.ensureProfiles = {
|
||||
environmentFiles = [ config.sops.templates."nm_wifi_secrets.env".path ];
|
||||
profiles = {
|
||||
WRT_Personal = {
|
||||
authProtocols = [ "SAE" ];
|
||||
pskRaw = "ext:WRT_Personal_PSK";
|
||||
priority = 100;
|
||||
extraConfig = ''
|
||||
ieee80211w=2
|
||||
pairwise=CCMP
|
||||
group=CCMP
|
||||
mac_addr=0
|
||||
'';
|
||||
connection = {
|
||||
id = "WRT_Personal";
|
||||
type = "wifi";
|
||||
uuid = "d31db7fa-aa1f-479d-8410-675f7175406c";
|
||||
};
|
||||
wifi.ssid = "WRT_Personal";
|
||||
wifi-security = {
|
||||
key-mgmt = "sae";
|
||||
psk = "$WRT_Personal_PSK";
|
||||
};
|
||||
};
|
||||
WLNPub = {
|
||||
# TODO Fix
|
||||
pskRaw = "ext:WLNPub_PSK";
|
||||
priority = 100;
|
||||
extraConfig = ''
|
||||
ieee80211w=2
|
||||
pairwise=CCMP
|
||||
group=CCMP
|
||||
mac_addr=0
|
||||
'';
|
||||
connection = {
|
||||
id = "WLNPub";
|
||||
type = "wifi";
|
||||
uuid = "7cca6ccd-641b-41e0-a0d2-aaed77394267";
|
||||
};
|
||||
wifi.ssid = "WLNPub";
|
||||
wifi-security = {
|
||||
key-mgmt = "sae";
|
||||
psk = "$WLNPub_PSK";
|
||||
};
|
||||
};
|
||||
ViliMobile = {
|
||||
authProtocols = [ "SAE" ];
|
||||
pskRaw = "ext:ViliMobile_PSK";
|
||||
priority = 50;
|
||||
extraConfig = ''
|
||||
ieee80211w=2
|
||||
pairwise=CCMP
|
||||
group=CCMP
|
||||
mac_addr=0
|
||||
'';
|
||||
connection = {
|
||||
id = "ViliMobile";
|
||||
type = "wifi";
|
||||
uuid = "0bba8429-5078-4da3-8af3-b27cc2b24b19";
|
||||
};
|
||||
wifi.ssid = "ViliMobile";
|
||||
wifi-security = {
|
||||
key-mgmt = "sae";
|
||||
psk = "$ViliMobile_PSK";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue