-
Notifications
You must be signed in to change notification settings - Fork 0
/
openvpn.nix
75 lines (68 loc) · 1.48 KB
/
openvpn.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ config, inputs, ... }:
let
secrets = inputs.secrets.secrets;
in {
environment.etc = {
"openvpn/mj.crt" = {
text = secrets.mj_openvpn_cert;
};
"openvpn/nh.crt" = {
text = secrets.nh_openvpn_cert;
};
"openvpn/auth-nh" = {
text = ''
${secrets.nh_login}
${secrets.nh_pass}
'';
};
"openvpn/auth-mj" = {
text = ''
${secrets.hms_login}
${secrets.hms_pass}
'';
};
"openvpn/nh.conf" = {
text = ''
client
remote ${secrets.nh_openvpn_host}
comp-lzo yes
mssfix 1200
dev tap
proto udp
nobind
auth-nocache
auth SHA512
cipher BF-CBC
data-ciphers AES-256-GCM:AES-128-GCM:BF-CBC
script-security 2
persist-key
persist-tun
auth-user-pass /etc/openvpn/auth-nh
ca "/etc/openvpn/nh.crt"
'';
};
"openvpn/mj.conf" = {
text = ''
client
port 1194
proto udp
dev tap
remote ${secrets.mj_openvpn_host}
tls-version-min 1.0
ca "/etc/openvpn/mj.crt"
auth-user-pass /etc/openvpn/auth-mj
comp-lzo
mssfix
auth SHA1
data-ciphers BF-CBC:AES-256-GCM:AES-128-GCM
script-security 3
daemon
nobind
verb 4
status /var/log/openvpn/openvpn-status.log 1
status-version 3
log-append /var/log/openvpn/openvpn-client.log
'';
};
};
}