diff options
author | lassulus <lassulus@lassul.us> | 2017-10-05 15:50:45 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-10-05 15:50:45 +0200 |
commit | ba663f044508ec596b6f9ab22a43e39677bcf3c2 (patch) | |
tree | 268d280daffe85d28de7e341a03eb4603a272da1 | |
parent | 4e6827b8cd1e1edce7a27a6d6b2afda6ce6b7bc9 (diff) |
l helios.r: add dcsovpn
-rw-r--r-- | lass/1systems/helios/config.nix | 1 | ||||
-rw-r--r-- | lass/2configs/dcso-vpn.nix | 44 |
2 files changed, 45 insertions, 0 deletions
diff --git a/lass/1systems/helios/config.nix b/lass/1systems/helios/config.nix index dd576e0fb..a94bbd3e9 100644 --- a/lass/1systems/helios/config.nix +++ b/lass/1systems/helios/config.nix @@ -11,6 +11,7 @@ with import <stockholm/lib>; <stockholm/lass/2configs/retiolum.nix> <stockholm/lass/2configs/otp-ssh.nix> <stockholm/lass/2configs/git.nix> + <stockholm/lass/2configs/dcso-vpn.nix> { # automatic hardware detection boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.kernelModules = [ "kvm-intel" ]; diff --git a/lass/2configs/dcso-vpn.nix b/lass/2configs/dcso-vpn.nix new file mode 100644 index 000000000..0a5623bf0 --- /dev/null +++ b/lass/2configs/dcso-vpn.nix @@ -0,0 +1,44 @@ +with import <stockholm/lib>; +{ ... }: + +{ + + users.extraUsers = { + dcsovpn = rec { + name = "dcsovpn"; + uid = genid "dcsovpn"; + description = "user for running dcso openvpn"; + home = "/home/${name}"; + }; + }; + + users.extraGroups.dcsovpn.gid = genid "dcsovpn"; + + services.openvpn.servers = { + dcso = { + config = '' + client + dev tun + tun-mtu 1356 + mssfix + proto udp + float + remote 217.111.55.41 1194 + nobind + user dcsovpn + group dcsovpn + persist-key + persist-tun + ca ${toString <secrets/dcsovpn/ca.pem>} + cert ${toString <secrets/dcsovpn/cert.pem>} + key ${toString <secrets/dcsovpn/cert.key>} + verb 3 + mute 20 + auth-user-pass ${toString <secrets/dcsovpn/login.txt>} + route-method exe + route-delay 2 + ''; + updateResolvConf = true; + }; + }; +} |