From 97f5ffd813d0aca79eb311517ec6a544f2805acf Mon Sep 17 00:00:00 2001 From: pinpox Date: Fri, 31 Oct 2025 12:30:12 +0100 Subject: [PATCH] clanServices/wireguard: add networking exports to controllers Part of https://git.clan.lol/clan/clan-core/issues/5549 --- clanServices/wireguard/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/clanServices/wireguard/default.nix b/clanServices/wireguard/default.nix index 6d1e7be47..e7f45c2ea 100644 --- a/clanServices/wireguard/default.nix +++ b/clanServices/wireguard/default.nix @@ -56,6 +56,8 @@ { clanLib, + lib, + directory, ... }: let @@ -298,6 +300,18 @@ in ... }: { + exports.networking = { + peers = lib.mapAttrs (name: _machine: { + host.plain = + clanLib.vars.getPublicValue { + flake = directory; + machine = name; + generator = "wireguard-network-${instanceName}"; + file = "prefix"; + } + + "::1"; + }) roles.controller.machines; + }; # Controllers connect to all peers and other controllers nixosModule =