mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
fix: openvpn
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
|
inherit (lib.strings) fileContents;
|
||||||
eduroam = {
|
eduroam = {
|
||||||
identity = lib.strings.fileContents <shared-secrets/eduroam/identity>;
|
identity = fileContents <shared-secrets/eduroam/identity>;
|
||||||
password = lib.strings.fileContents <shared-secrets/eduroam/password>;
|
password = fileContents <shared-secrets/eduroam/password>;
|
||||||
};
|
};
|
||||||
eduroamAuth = ''
|
eduroamAuth = ''
|
||||||
key_mgmt=WPA-EAP
|
key_mgmt=WPA-EAP
|
||||||
@@ -18,29 +19,21 @@ let
|
|||||||
}}"
|
}}"
|
||||||
phase2="auth=PAP"
|
phase2="auth=PAP"
|
||||||
'';
|
'';
|
||||||
only-hu-traffic = true;
|
|
||||||
in {
|
in {
|
||||||
networking.wireless.networks = {
|
networking.wireless.networks = {
|
||||||
eduroam_5GHz.auth = eduroamAuth;
|
eduroam_5GHz.auth = eduroamAuth;
|
||||||
eduroam.auth = eduroamAuth;
|
eduroam.auth = eduroamAuth;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openvpn.servers = {
|
services.openvpn.servers.hu-berlin = {
|
||||||
hu-berlin = {
|
autoStart = false;
|
||||||
config = ''
|
authUserPass = {
|
||||||
config ${pkgs.fetchurl {
|
username = eduroam.identity;
|
||||||
url = https://www.cms.hu-berlin.de/de/dl/netze/vpn/openvpn/hu-berlin.ovpn;
|
password = eduroam.password;
|
||||||
sha256 = "15b55aibik5460svjq2gwxrcyh6ay4k8savd6cd5lncgndmd8p8h";
|
|
||||||
}}
|
|
||||||
${lib.optionalString only-hu-traffic ''
|
|
||||||
route-nopull
|
|
||||||
route 141.20.0.0 255.255.0.0
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
authUserPass = {
|
|
||||||
username = eduroam.identity;
|
|
||||||
password = eduroam.password;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
config = fileContents (pkgs.fetchurl {
|
||||||
|
url = https://www.cms.hu-berlin.de/de/dl/netze/vpn/openvpn/hu-berlin.ovpn;
|
||||||
|
sha256 = "15b55aibik5460svjq2gwxrcyh6ay4k8savd6cd5lncgndmd8p8h";
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user