1 { pkgs, lib, config, ... }:
4 inherit (config.services) openvpn;
5 inherit (config.security) gnupg;
8 services.netns.namespaces.${netns} = {
9 nftables = lib.mkBefore ''
11 include "${../../../../var/nftables/filter.txt}"
13 type filter hook input priority filter
17 ct state { established, related } accept
18 jump accept-connectivity-input
23 type filter hook forward priority filter
25 jump accept-connectivity-forward
28 type filter hook output priority filter
31 ct state { related, established } accept
32 jump accept-connectivity-output
37 services.openvpn.servers.${netns} = {
41 auth-user-pass = gnupg.secrets."openvpn/${netns}/auth-user-pass".path;
42 ca = riseup/RiseupCA.pem;
50 remote-cert-tls = "server";
51 remote = "198.252.153.226 1194 udp";
57 security.gnupg.secrets."openvpn/${netns}/auth-user-pass" = {
58 systemdConfig.before = [ "openvpn-${netns}.service" ];
59 systemdConfig.wantedBy = [ "openvpn-${netns}.service" ];
61 networking.nftables.ruleset = ''
62 add rule inet filter fw2net udp dport 1194 counter accept comment "OpenVPN"