modules/hyprspace: add route configuration support
This commit is contained in:
parent
16e4664899
commit
d2674bdb5a
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,9 @@ let
|
||||||
myNode = hosts.${hostName};
|
myNode = hosts.${hostName};
|
||||||
listenPort = myNode.hypr.listenPort or 8001;
|
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 {
|
interfaceConfig = pkgs.writeText "hyprspace.yml" (builtins.toJSON {
|
||||||
interface = {
|
interface = {
|
||||||
name = "hyprspace";
|
name = "hyprspace";
|
||||||
|
@ -18,6 +21,7 @@ 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…
Reference in a new issue