diff options
author | Kjetil Ørbekk <kj@orbekk.com> | 2017-11-24 12:54:12 -0500 |
---|---|---|
committer | Kjetil Ørbekk <kj@orbekk.com> | 2017-11-24 12:54:12 -0500 |
commit | fc32a98da32af36e25b5478319d2d62601235e43 (patch) | |
tree | 206d66ce16b1bd3877e30f58ebf7bfb69e44511e /config | |
parent | dbdee4a2c1008e5a1544b49894969b91af850fbc (diff) |
wireguard server
Diffstat (limited to 'config')
-rw-r--r-- | config/vpn-server.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/config/vpn-server.nix b/config/vpn-server.nix new file mode 100644 index 0000000..f2663d5 --- /dev/null +++ b/config/vpn-server.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: +let + port = (import ../data/aliases.nix).services.wireguard.port; +in +{ + networking.wireguard = { + interfaces = { + wg0 = { + ips = [ "10.35.190.1/23" ]; + privateKeyFile = "/opt/secret/wireguard/wg0.key"; + listenPort = port; + peers = [ + { + publicKey = "ULWhaOsAaTu4cu84v3PM4DL7arxc/WNnzI/ic2k1KBU="; + allowedIPs = ["0.0.0.0/0" "::/0"]; + } + ]; + }; + }; + }; +} |