clan-core/clanModules/zt-tcp-relay/default.nix
Qubasa 570f04ecdc
All checks were successful
checks / checks-impure (pull_request) Successful in 2m12s
checks / checks (pull_request) Successful in 4m17s
Fix zt-tcp-relay
2024-05-02 16:59:17 +02:00

32 lines
710 B
Nix

{
pkgs,
lib,
config,
...
}:
{
options.clan.zt-tcp-relay = {
port = lib.mkOption {
type = lib.types.port;
default = 4443;
description = "Port to listen on";
};
};
config = {
networking.firewall.allowedTCPPorts = [ config.clan.zt-tcp-relay.port ];
systemd.services.zt-tcp-relay = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${
pkgs.callPackage ../../pkgs/zt-tcp-relay { }
}/bin/zt-tcp-relay --listen [::]:${builtins.toString config.clan.zt-tcp-relay.port}";
Restart = "always";
RestartSec = "5";
dynamicUsers = true;
};
};
};
}