From d4dd78909f49ad1b70971fa501a99556363baa47 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 23 Jan 2023 19:30:32 +0100 Subject: [PATCH] modules/hyprspace: use new config file format --- modules/hyprspace/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/hyprspace/default.nix b/modules/hyprspace/default.nix index 6d40f37..9bf0d6c 100644 --- a/modules/hyprspace/default.nix +++ b/modules/hyprspace/default.nix @@ -3,10 +3,12 @@ let inherit (config.networking) hostName; inherit (inputs.depot.packages.${pkgs.system}) hyprspace; hyprspaceCapableNodes = lib.filterAttrs (_: host: host ? hypr) hosts; - peersFormatted = builtins.mapAttrs (_: x: { "${x.hypr.addr}".id = x.hypr.id; }) hyprspaceCapableNodes; + peersFormatted = builtins.mapAttrs (_: x: { + inherit (x.hypr) id; + routes = map (net: { inherit net; }) ((x.hypr.routes or []) ++ [ "${x.hypr.addr}/32" ]); + }) hyprspaceCapableNodes; peersFiltered = lib.filterAttrs (name: _: name != hostName) peersFormatted; - peers = lib.foldAttrs (n: _: n) null (builtins.attrValues peersFiltered); - peerList = lib.foldAttrs (n: _: n) null (builtins.attrValues peersFiltered); + peerList = builtins.attrValues peersFiltered; myNode = hosts.${hostName}; listenPort = myNode.hypr.listenPort or 8001; @@ -22,7 +24,6 @@ let private_key = "@HYPRSPACEPRIVATEKEY@"; }; peers = peerList; - inherit routes; }); privateKeyFile = config.age.secrets.hyprspace-key.path;