1
Fork 0
satellite/hosts/nixos/common/optional/services/wpa_supplicant.nix

58 lines
1.8 KiB
Nix
Raw Normal View History

2024-08-05 20:31:34 +02:00
{ config, ... }:
{
2024-01-31 20:03:00 +01:00
sops.secrets.wireless.sopsFile = ../../secrets.yaml;
2023-01-10 02:38:06 +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
2025-01-18 23:55:49 +01:00
secretsFile = config.sops.secrets.wireless.path;
2023-01-10 02:38:06 +01:00
networks = {
2025-01-18 23:55:49 +01:00
"Neptune".pskRaw = "ext:ENCELADUS_HOTSPOT_PASS";
2025-01-18 23:55:49 +01:00
"Familia-Matei-PRO".pskRaw = "ext:TG_HOTSPOT_HOME_PASS";
"Familia-Matei".pskRaw = "ext:TG_HOTSPOT_HOME_PASS";
2023-07-21 18:30:48 +02:00
2025-01-18 23:55:49 +01:00
"R15-5365 5g".pskRaw = "ext:TG_WIFI_HOME_PASS";
"R15-5365".pskRaw = "ext:TG_WIFI_HOME_PASS";
2023-07-21 18:30:48 +02:00
2025-01-18 23:55:49 +01:00
"Sailhorse".pskRaw = "ext:NL_PLACE_0_PASS";
"Ziggo1721699".pskRaw = "ext:NL_PLACE_1_PASS";
"Konijntjes".pskRaw = "ext:NL_PLACE_1_PODS_PASS";
"InfoEdu12".pskRaw = "ext:INFOEDU_PASS";
"CNU19".pskRaw = "ext:INFOEDU_PASS";
"ZTE_F7A321".pskRaw = "ext:MADALINA_PASS";
# [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"
2025-01-18 23:55:49 +01:00
password="ext:EDUROAM_PASS"
'';
extraConfig = ''
phase2="auth=MSCHAPV2"
'';
};
2023-01-10 02:38:06 +01:00
};
# Imperative
allowAuxiliaryImperativeNetworks = true;
userControlled = {
enable = true;
group = "network";
};
2023-01-10 02:38:06 +01:00
};
# Ensure group exists
users.groups.network = { };
2024-01-18 07:44:16 +01:00
# The service seems to fail if this file does not exist
systemd.tmpfiles.rules = [ "f /etc/wpa_supplicant.conf" ];
2023-01-10 02:38:06 +01:00
}