From 430d7e30c0a922de555fcce727a36912c956cd03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Av=C3=A9?= <email@thomasave.be>
Date: Thu, 13 Jun 2024 13:58:30 +0200
Subject: [PATCH] Add Wireguard to NixVM

---
 hosts/NixVM/default.nix | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hosts/NixVM/default.nix b/hosts/NixVM/default.nix
index fa3e75a..5ec1376 100644
--- a/hosts/NixVM/default.nix
+++ b/hosts/NixVM/default.nix
@@ -3,4 +3,17 @@
   imports = [
     (import ../Common/default.nix { inherit inputs config pkgs; })
   ];
+
+  networking.wg-quick.interfaces = {
+    wg0 = {
+      address = [ "10.0.0.13/24" ];
+      privateKeyFile = "/home/user/.secrets/Wireguard/NixVM.key";
+      listenPort = 51820;
+      peers = [{
+        publicKey = "/9ppjm3yeD0duDvxrqgcHscHmftXko+0s2RbivNEy2c=";
+        allowedIPs = [ "10.0.0.1/8" ];
+        endpoint = "192.168.1.1:13231";
+      }];
+    };
+  };
 }