1 { pkgs, lib, config, ... }:
4 inherit (config.services) openvpn;
5 inherit (config.security) gnupg;
8 networking.nftables.ruleset = ''
9 #add rule inet filter fw2net tcp dport {443,1194} counter accept comment "OpenVPN"
10 add rule inet filter fw2net udp dport 1194 counter accept comment "OpenVPN"
12 services.netns.namespaces.riseup = {
13 nftables = lib.mkBefore ''
15 include "${../../../../var/nftables/filter.txt}"
17 type filter hook input priority filter
21 ct state { established, related } accept
22 jump accept-connectivity-input
27 type filter hook forward priority filter
29 jump accept-connectivity-forward
32 type filter hook output priority filter
35 ct state { related, established } accept
36 jump accept-connectivity-output
41 security.gnupg.secrets."openvpn/riseup/auth-user-pass" = {
42 systemdConfig.before = [ "openvpn-riseup.service" ];
43 systemdConfig.wantedBy = [ "openvpn-riseup.service" ];
45 services.openvpn.servers.${ns} = {
47 cert ${riseup/client.pem}
48 key ${riseup/client.pem}
49 remote 37.218.241.7 1194 tcp4
50 remote 37.218.241.106 443 tcp4
51 remote 163.172.126.44 443 tcp4
52 remote 198.252.153.28 443 tcp4
53 remote 199.58.81.143 443 tcp4
54 remote 199.58.81.145 443 tcp4
55 remote 212.83.143.67 443 tcp4
56 remote 212.83.144.12 443 tcp4
57 remote 212.83.146.228 443 tcp4
58 remote 212.83.165.160 443 tcp4
59 remote 212.83.182.127 443 tcp4
60 remote 212.129.62.247 443 tcp4
61 ca ${riseup/cacert.pem}
66 auth-user-pass = gnupg.secrets."openvpn/riseup/auth-user-pass".path;
67 ca = riseup/RiseupCA.pem;
75 remote-cert-tls = "server";
76 remote = "198.252.153.226 1194 udp";