modules/hyprspace: use new config format

This commit is contained in:
Max Headroom 2023-10-27 00:45:16 +02:00
parent 9954f8eb03
commit f6e6815aa5

View file

@ -14,12 +14,14 @@ let
listenPort = myNode.hyprspace.listenPort or 8001; listenPort = myNode.hyprspace.listenPort or 8001;
interfaceConfig = pkgs.writeText "hyprspace.json" (builtins.toJSON { interfaceConfig = pkgs.writeText "hyprspace.json" (builtins.toJSON {
interface = { listenAddresses = let
name = "hyprspace"; inherit (myNode.interfaces.primary) addr;
listen_port = listenPort; port = toString listenPort;
inherit (myNode.hyprspace) id; in [
private_key = "@HYPRSPACEPRIVATEKEY@"; "/ip4/${addr}/tcp/${port}"
}; "/ip4/${addr}/udp/${port}/quic-v1"
];
privateKey = "@HYPRSPACEPRIVATEKEY@";
peers = peerList; peers = peerList;
}); });
@ -50,8 +52,7 @@ in {
Group = "wheel"; Group = "wheel";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "5s"; RestartSec = "5s";
ExecStart = "${hyprspace}/bin/hyprspace up hyprspace -f -c ${runConfig}"; ExecStart = "${hyprspace}/bin/hyprspace up -c ${runConfig}";
ExecStop = "${hyprspace}/bin/hyprspace down hyprspace";
ExecStopPost = "${pkgs.coreutils}/bin/rm -f /run/hyprspace-rpc.hyprspace.sock"; ExecStopPost = "${pkgs.coreutils}/bin/rm -f /run/hyprspace-rpc.hyprspace.sock";
IPAddressDeny = [ IPAddressDeny = [
"10.0.0.0/8" "10.0.0.0/8"