1 { inputs, pkgs, lib, config, ... }:
4 inherit (config.services) openvpn;
5 apiUrl = "https://api.black.riseup.net/3/cert";
8 url = "https://black.riseup.net/ca.crt";
9 hash = "sha256-Zdvnfz2k7iWlbgmmcUJrpJZ1dp7o0qXeJhP0HWJD7ro=";
11 key-cert = "/run/openvpn-${netns}/key+cert.pem";
14 services.openvpn.servers.${netns} = {
19 [ "212.83.182.127" "212.83.165.160" "212.129.4.141" ] ++
21 #["212.83.146.228" "212.83.143.67" "163.172.126.44"] ++
23 [ "37.218.244.249" "37.218.244.251" ] ++
25 [ "199.58.83.10" "199.58.83.10" "199.58.83.12" ] ++
27 [ "185.220.103.12" ] ++
29 [ "198.252.153.28" "198.252.153.28" ] ++
39 cipher = "AES-128-CBC";
47 remote-cert-tls = "server";
50 tls-cipher = "TLS-DHE-RSA-WITH-AES-128-CBC-SHA";
57 systemd.services."openvpn-${netns}" = {
60 ${pkgs.curl}/bin/curl -v -X POST --cacert ${ca} -o ${key-cert} -Ls ${apiUrl}
64 StartLimitIntervalSec = 0;
67 RuntimeDirectory = [ "openvpn-${netns}" ];
68 RuntimeDirectoryMode = "0700";
71 environment.systemPackages = [
74 networking.nftables.ruleset = ''
77 skuid root tcp dport https counter accept comment "OpenVPN Riseup"
81 services.netns.namespaces.${netns} = {
82 nftables = lib.mkBefore ''
83 include "${inputs.julm-nix + "/nixos/profiles/networking/nftables.txt"}"