modules/hyprspace: use new config file format
This commit is contained in:
parent
a28f6eb487
commit
d4dd78909f
1 changed files with 5 additions and 4 deletions
|
@ -3,10 +3,12 @@ let
|
||||||
inherit (config.networking) hostName;
|
inherit (config.networking) hostName;
|
||||||
inherit (inputs.depot.packages.${pkgs.system}) hyprspace;
|
inherit (inputs.depot.packages.${pkgs.system}) hyprspace;
|
||||||
hyprspaceCapableNodes = lib.filterAttrs (_: host: host ? hypr) hosts;
|
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;
|
peersFiltered = lib.filterAttrs (name: _: name != hostName) peersFormatted;
|
||||||
peers = lib.foldAttrs (n: _: n) null (builtins.attrValues peersFiltered);
|
peerList = builtins.attrValues peersFiltered;
|
||||||
peerList = lib.foldAttrs (n: _: n) null (builtins.attrValues peersFiltered);
|
|
||||||
myNode = hosts.${hostName};
|
myNode = hosts.${hostName};
|
||||||
listenPort = myNode.hypr.listenPort or 8001;
|
listenPort = myNode.hypr.listenPort or 8001;
|
||||||
|
|
||||||
|
@ -22,7 +24,6 @@ let
|
||||||
private_key = "@HYPRSPACEPRIVATEKEY@";
|
private_key = "@HYPRSPACEPRIVATEKEY@";
|
||||||
};
|
};
|
||||||
peers = peerList;
|
peers = peerList;
|
||||||
inherit routes;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
privateKeyFile = config.age.secrets.hyprspace-key.path;
|
privateKeyFile = config.age.secrets.hyprspace-key.path;
|
||||||
|
|
Loading…
Add table
Reference in a new issue