From d2674bdb5aaa5dc2d674c2b13d5c7cbf3b2ba219 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 8 Oct 2022 12:08:34 +0200 Subject: [PATCH] modules/hyprspace: add route configuration support --- modules/hyprspace/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/hyprspace/default.nix b/modules/hyprspace/default.nix index ceb90a8..7d8f923 100644 --- a/modules/hyprspace/default.nix +++ b/modules/hyprspace/default.nix @@ -9,6 +9,9 @@ let myNode = hosts.${hostName}; listenPort = myNode.hypr.listenPort or 8001; + routes' = map (x: lib.genAttrs (x.hypr.routes or []) (_: { ip = x.hypr.addr; })) (builtins.attrValues hyprspaceCapableNodes); + routes = builtins.foldl' (x: y: x // y) {} (lib.flatten routes'); + interfaceConfig = pkgs.writeText "hyprspace.yml" (builtins.toJSON { interface = { name = "hyprspace"; @@ -18,6 +21,7 @@ let private_key = "@HYPRSPACEPRIVATEKEY@"; }; peers = peerList; + inherit routes; }); privateKeyFile = config.age.secrets.hyprspace-key.path;