Use systemd.network.networks instead of networking.interfaces

This fixes the 90 second timeout for unconnected interfaces
This commit is contained in:
Charlotte Van Petegem 2022-11-04 23:42:56 +01:00
parent e04ddb39b4
commit cd1d80a3ff
No known key found for this signature in database
GPG key ID: 019E764B7184435A

View file

@ -16,44 +16,53 @@
};
config = with config.chvp.base.network.mobile; lib.mkIf enable {
networking = {
wireless = {
enable = true;
interfaces = [ wireless-interface ];
environmentFile = config.age.secrets."passwords/networks.age".path;
networks = {
"Public Universal Friend".psk = "@PSK_PUF@";
AndroidAP.psk = "@PSK_AndroidAP@";
draadloosnw.psk = "@PSK_draadloosnw@";
werknet.psk = "@PSK_werknet@";
Secorima.psk = "@PSK_Secorima@";
"Zeus WPI" = {
psk = "@PSK_Zeus@";
hidden = true;
};
"Zeus Event 5G".psk = "@PSK_Zeus@";
eduroam = {
authProtocols = [ "WPA-EAP" ];
auth = ''
eap=PEAP
identity="@EDUROAM_USER@"
password="@EDUROAM_PASS@"
'';
extraConfig = ''
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
group=CCMP TKIP
ca_cert="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
altsubject_match="DNS:radius.ugent.be"
'';
};
"GUK-huis".psk = "@PSK_GUKhuis@";
networking.wireless = {
enable = true;
interfaces = [ wireless-interface ];
environmentFile = config.age.secrets."passwords/networks.age".path;
networks = {
"Public Universal Friend".psk = "@PSK_PUF@";
AndroidAP.psk = "@PSK_AndroidAP@";
draadloosnw.psk = "@PSK_draadloosnw@";
werknet.psk = "@PSK_werknet@";
Secorima.psk = "@PSK_Secorima@";
"Zeus WPI" = {
psk = "@PSK_Zeus@";
hidden = true;
};
"Zeus Event 5G".psk = "@PSK_Zeus@";
eduroam = {
authProtocols = [ "WPA-EAP" ];
auth = ''
eap=PEAP
identity="@EDUROAM_USER@"
password="@EDUROAM_PASS@"
'';
extraConfig = ''
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
group=CCMP TKIP
ca_cert="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
altsubject_match="DNS:radius.ugent.be"
'';
};
"GUK-huis".psk = "@PSK_GUKhuis@";
};
interfaces = {
"${wireless-interface}".useDHCP = true;
} // lib.mapAttrs (name: attrs: { useDHCP = true; } // attrs) wired-interfaces;
};
systemd.network = {
enable = true;
networks = {
"${wireless-interface}" = {
enable = true;
DHCP = "yes";
matchConfig = { Name = wireless-interface; };
};
} // lib.mapAttrs (name: attrs: {
enable = true;
DHCP = "yes";
matchConfig = { Name = name; };
} // attrs) wired-interfaces;
wait-online.anyInterface = true;
};
age.secrets."passwords/networks.age" = {