1
0
mirror of https://github.com/kmein/niveum synced 2026-03-19 19:41:08 +01:00
Files
niveum/configs/hu-berlin.nix

40 lines
1.2 KiB
Nix
Raw Normal View History

2019-06-18 09:23:20 +02:00
{ pkgs, lib, ... }:
2019-01-08 18:22:54 +01:00
let
2020-01-18 08:02:02 +01:00
inherit (lib.strings) fileContents;
2019-06-18 09:23:20 +02:00
eduroam = {
2020-01-18 08:02:02 +01:00
identity = fileContents <shared-secrets/eduroam/identity>;
password = fileContents <shared-secrets/eduroam/password>;
2019-06-18 09:23:20 +02:00
};
2019-05-14 07:18:04 +02:00
eduroamAuth = ''
key_mgmt=WPA-EAP
eap=TTLS
proto=RSN
identity="${eduroam.identity}"
anonymous_identity="anonymous@wlan.hu-berlin.de"
altsubject_match="DNS:srv1-radius.cms.hu-berlin.de;DNS:srv2-radius.cms.hu-berlin.de"
password="${eduroam.password}"
ca_cert="${pkgs.fetchurl {
url = https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/t-telesec_globalroot_class_2.pem;
2019-08-08 14:12:02 +02:00
sha256 = "0if8aqd06sid7a0vw009zpa087wxcgdd2x6z2zs4pis5kvyqj2dk";
2019-05-14 07:18:04 +02:00
}}"
phase2="auth=PAP"
'';
2019-01-08 18:22:54 +01:00
in {
networking.wireless.networks = {
2019-05-14 07:18:04 +02:00
eduroam_5GHz.auth = eduroamAuth;
eduroam.auth = eduroamAuth;
2019-01-08 18:22:54 +01:00
};
2020-01-18 08:02:02 +01:00
services.openvpn.servers.hu-berlin = {
autoStart = false;
authUserPass = {
username = eduroam.identity;
password = eduroam.password;
2019-01-08 18:22:54 +01:00
};
2020-01-18 08:02:02 +01:00
config = fileContents (pkgs.fetchurl {
url = https://www.cms.hu-berlin.de/de/dl/netze/vpn/openvpn/hu-berlin.ovpn;
sha256 = "15b55aibik5460svjq2gwxrcyh6ay4k8savd6cd5lncgndmd8p8h";
});
2019-01-08 18:22:54 +01:00
};
}