From 73090f76d499b79db1b56125ca198592d6f34f8e Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sun, 8 Oct 2023 13:42:23 +0530 Subject: [PATCH] setup wireguard peers --- hosts/skipper/wireguard.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hosts/skipper/wireguard.nix b/hosts/skipper/wireguard.nix index 8fc0cb9..cac32ad 100644 --- a/hosts/skipper/wireguard.nix +++ b/hosts/skipper/wireguard.nix @@ -1,14 +1,17 @@ -_: { - networking.wireguard = { +{secrets, ...}: { + networking.wireguard = let + inherit (secrets.wireguard_config) server; + inherit (secrets.wireguard_config) peers; + in { enable = true; interfaces = { wg0 = { - ips = [ - "10.8.1.2/24" - "fdd9:69ae:9703::2/64" - ]; + inherit (peers."1") ips; privateKeyFile = "/etc/wireguard/private.key"; generatePrivateKeyFile = true; + peers = [ + server + ]; }; }; };