summaryrefslogtreecommitdiff
path: root/hosts/cez/modules
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-09-17 13:59:03 +0530
committersinanmohd <sinan@sinanmohd.com>2023-09-17 15:22:50 +0530
commitbf8a48eae55bec89f06508136d65ee98ceace558 (patch)
tree954ef88efe5c3acd2163fbfc2c0c55e73b82188b /hosts/cez/modules
parentfabfc1b30919e58c1409da72b6f95b36110a575e (diff)
networking/wireguard: init
Diffstat (limited to 'hosts/cez/modules')
-rw-r--r--hosts/cez/modules/wireguard.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/hosts/cez/modules/wireguard.nix b/hosts/cez/modules/wireguard.nix
new file mode 100644
index 0000000..07ea90c
--- /dev/null
+++ b/hosts/cez/modules/wireguard.nix
@@ -0,0 +1,22 @@
+{ config, ... }:
+
+let
+ domain = config.userdata.domain;
+in
+{
+ sops.secrets."misc/wireguard" = {};
+
+ networking.wg-quick.interfaces."wg" = {
+ address = [ "10.0.1.2/24" ];
+ dns = [ "10.0.1.1" ];
+ mtu = 1380;
+ privateKeyFile = config.sops.secrets."misc/wireguard".path;
+
+ peers = [{
+ publicKey = "wJMyQDXmZO4MjYRk6NK4+J6ZKWLTTZygAH+OwbPjOiw=";
+ allowedIPs = [ "0.0.0.0/0" ];
+ endpoint = "${domain}:51820";
+ persistentKeepalive = 25;
+ }];
+ };
+}