2023-01-10 02:38:06 +01:00
|
|
|
{ config, lib, ... }: {
|
|
|
|
# Wireless secrets stored through agenix
|
2023-01-10 16:05:48 +01:00
|
|
|
age.secrets.wireless.file = ./wifi_passwords.age;
|
2023-01-10 02:38:06 +01:00
|
|
|
|
2023-02-28 13:11:37 +01:00
|
|
|
# https://github.com/NixOS/nixpkgs/blob/nixos-22.11/nixos/modules/services/networking/wpa_supplicant.nix
|
2023-01-10 02:38:06 +01:00
|
|
|
networking.wireless = {
|
|
|
|
enable = true;
|
|
|
|
fallbackToWPA2 = false;
|
|
|
|
|
|
|
|
# Declarative
|
|
|
|
environmentFile = config.age.secrets.wireless.path;
|
|
|
|
networks = {
|
|
|
|
"Neptune".psk = "@PHONE_HOTSPOT_PASS@";
|
2023-04-13 19:06:57 +02:00
|
|
|
"Familia-Matei".psk = "@TG_HOME_PASS@";
|
2023-07-06 21:34:24 +02:00
|
|
|
"Familia-Matei-PRO".psk = "@TG_HOME_PASS@";
|
2023-01-15 21:37:30 +01:00
|
|
|
"Sailhorse".psk = "@NL_SAILHORSE_PASS@";
|
2023-02-28 13:11:37 +01:00
|
|
|
|
|
|
|
"FOSDEM-Dualstack" = { };
|
|
|
|
|
|
|
|
# [Working solution](https://bbs.archlinux.org/viewtopic.php?id=271336)
|
|
|
|
# [Other interesting link](https://help.itc.rwth-aachen.de/en/service/b3d9a2c8ae5345b8b8f5128143ef4e3c/article/eaf6d69389a74a5a839c1f383c508df7/)
|
|
|
|
# [Uni link](https://lwpwiki.webhosting.rug.nl/index.php/Configure_your_wifi_for_Eduroam)
|
|
|
|
"eduroam" = {
|
|
|
|
authProtocols = [ "WPA-EAP" ];
|
|
|
|
auth = ''
|
|
|
|
eap=PEAP
|
|
|
|
identity="s5260329@rug.nl"
|
|
|
|
password="@EDUROAM_PASS@"
|
|
|
|
'';
|
|
|
|
extraConfig = ''
|
|
|
|
phase2="auth=MSCHAPV2"
|
|
|
|
'';
|
|
|
|
};
|
2023-01-10 02:38:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Imperative
|
2023-07-06 21:34:24 +02:00
|
|
|
allowAuxiliaryImperativeNetworks = true;
|
|
|
|
userControlled = {
|
|
|
|
enable = true;
|
|
|
|
group = "network";
|
|
|
|
};
|
2023-01-10 02:38:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Ensure group exists
|
|
|
|
users.groups.network = { };
|
|
|
|
|
|
|
|
# Persist imperative config
|
2023-06-09 13:17:34 +02:00
|
|
|
environment.persistence."/persist/state".files = [
|
|
|
|
# TODO: investigate why this doesn't work
|
|
|
|
# "/etc/wpa_supplicant.conf"
|
|
|
|
];
|
2023-01-10 02:38:06 +01:00
|
|
|
}
|