From 35ee492fd5b3f4e0d1c09aa22abdbfcb0ecee1e5 Mon Sep 17 00:00:00 2001 From: caley <195605706+cqley@users.noreply.github.com> Date: Sat, 25 Jul 2026 03:02:09 +0200 Subject: Add WireGuard configuration for wg0 interface --- nixos/hosts/box/components/wireguard.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nixos/hosts/box/components/wireguard.nix (limited to 'nixos/hosts/box/components/wireguard.nix') diff --git a/nixos/hosts/box/components/wireguard.nix b/nixos/hosts/box/components/wireguard.nix new file mode 100644 index 0000000..37db0a1 --- /dev/null +++ b/nixos/hosts/box/components/wireguard.nix @@ -0,0 +1,17 @@ +{ + networking.firewall.allowedUDPPorts = [ 51820 ]; + + networking.wireguard.interfaces.wg0 = { + ips = [ "10.0.0.2/24" ]; + privateKeyFile = "/var/lib/wireguard/privatekey"; + + peers = [ + { + publicKey = "P2LPLBq/6qXE5Mmv8DJUviU89Yu5s7vysbyWncnZchY="; + allowedIPs = [ "10.0.0.0/24" ]; + endpoint = "5.231.118.254:51820"; + persistentKeepalive = 25; + } + ]; + }; +} -- cgit v1.3.1