From f57302b0c3ccd17f5cb491f1a9f72ff132cf72f4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 29 Jul 2022 11:13:59 +0200 Subject: ... --- hosts/surtr/vpn/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'hosts/surtr/vpn/default.nix') diff --git a/hosts/surtr/vpn/default.nix b/hosts/surtr/vpn/default.nix index f14312be..570fe1da 100644 --- a/hosts/surtr/vpn/default.nix +++ b/hosts/surtr/vpn/default.nix @@ -59,12 +59,12 @@ in { PrivateKeyFile = "/etc/wireguard/surtr.priv"; ListenPort = 51820; }; - wireguardPeers = [ - { wireguardPeerConfig = { - AllowedIPs = ["${prefix6}:1::/96" "${prefix4}.1/32"]; - PublicKey = trim (readFile ./geri.pub); - }; - } + wireguardPeers = imap1 (i: { name, ip ? i }: { + wireguardPeerConfig = { + AllowedIPs = ["${prefix6}:${ip}::/96" "${prefix4}.${ip}/32"]; + PublicKey = trim (readFile (./. + "${name}.pub")); + }; + }) [ { name = "geri"; } ]; ]; }; }; -- cgit v1.2.3