From 65794e385667d394fd126e3bc1de30a9874b66d6 Mon Sep 17 00:00:00 2001 From: caley <195605706+cqley@users.noreply.github.com> Date: Sat, 25 Jul 2026 03:04:20 +0200 Subject: Create wireguard.nix --- nixos/hosts/bin/components/wireguard.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nixos/hosts/bin/components/wireguard.nix (limited to 'nixos/hosts/bin/components') diff --git a/nixos/hosts/bin/components/wireguard.nix b/nixos/hosts/bin/components/wireguard.nix new file mode 100644 index 0000000..03371bc --- /dev/null +++ b/nixos/hosts/bin/components/wireguard.nix @@ -0,0 +1,23 @@ +{ + networking.firewall.allowedUDPPorts = [ 51820 ]; + networking.firewall.trustedInterfaces = [ "wg0" ]; + + networking.wireguard.interfaces.wg0 = { + ips = [ "10.0.0.1/24" ]; + listenPort = 51820; + privateKeyFile = "/var/lib/wireguard/privatekey"; + + peers = [ + # PC + { + publicKey = "BdQ1JoAFU5XGFfZDNPEUk78zI8yLLReSWdVbeETwNX4="; + allowedIPs = [ "10.0.0.2/32" ]; + } + # Laptop + { + publicKey = " "; + allowedIPs = [ "10.0.0.3/32" ]; + } + ]; + }; +} -- cgit v1.3.1