roles/syncthingserver: initial implementation

This commit is contained in:
2025-07-27 00:05:04 -07:00
parent 5d3ff22e9f
commit 34bece7b0f

View File

@@ -15,7 +15,49 @@ in
{
options.syncthingserver = {
enable = mkEnableOption "Enables syncthingserver role";
guiInterface = mkOption {
type = types.str;
default = "0.0.0.0";
description = "Interface the GUI should be listening on";
example = "localhost";
};
guiPort = mkOption {
type = types.int;
default = 8384;
description = "Port for syncthing GUI";
example = 8384;
};
};
config = mkIf cfg.enable { };
config = mkIf cfg.enable {
services.syncthing = {
enable = true;
relay.enable = true;
autoAcceptFolders = true;
guiAddress = "${cfg.guiInterface}:${toString guiPort}";
dataDir = "/mnt/data/syncthing";
overrideDevices = false;
overrideFolders = false;
settings = {
# don't accept tracking
options.urAccepted = -1;
};
};
networking.firewall.allowedTCPPorts = [
cfg.guiPort
config.services.syncthing.relay.port
];
networking.firewall.allowedUDPPorts = [
22000
21027
];
};
}