diff options
| author | caley <195605706+cqley@users.noreply.github.com> | 2026-07-25 03:04:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-25 03:04:20 +0200 |
| commit | 65794e385667d394fd126e3bc1de30a9874b66d6 (patch) | |
| tree | 76edf0e1bead4f43b0093e43b76b1d5b059047d2 /nixos | |
| parent | 8a9413cb8fcad195c30cbe6ccb95fe5e8275b43f (diff) | |
Create wireguard.nix
Diffstat (limited to 'nixos')
| -rw-r--r-- | nixos/hosts/bin/components/wireguard.nix | 23 |
1 files changed, 23 insertions, 0 deletions
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" ]; + } + ]; + }; +} |
