config/modules/services/syncthing-relay/default.nix

24 lines
539 B
Nix
Raw Permalink Normal View History

2024-08-03 18:11:44 +03:00
{ config, lib, ... }:
let
cfg = config.mj.services.syncthing-relay;
in
{
options.mj.services.syncthing-relay = with lib.types; {
enable = lib.mkEnableOption "enable syncthing-relay";
};
config = lib.mkIf cfg.enable {
services.syncthing.relay = {
enable = true;
providedBy = "jakstys.lt";
};
systemd.services.syncthing-relay.restartIfChanged = false;
networking.firewall.allowedTCPPorts = [
config.services.syncthing.relay.port
config.services.syncthing.relay.statusPort
];
};
}