This commit is contained in:
mups 2024-07-19 20:46:38 +00:00
parent 3646ade4b4
commit 7f0d973b75
4 changed files with 30 additions and 1 deletions

View file

@ -4,5 +4,6 @@
./gaming
./media.nix
./sync.nix
];
}

View file

@ -0,0 +1,25 @@
{ pkgs, lib, config, ... }: let
cfg = config.mods.server.sync;
in {
options.mods.server.sync = {
enable = lib.mkEnableOption {
default = false;
description = "enables synchronisation related servers";
};
address = lib.mkOption {
default = "127.0.0.1";
};
port = lib.mkOption {
default = "8384";
};
};
config = lib.mkIf cfg.enable {
services.syncthing.enable = true;
networking.firewall.allowedTCPPorts = [ 8384 22000 ];
networking.firewall.allowedUDPPorts = [ 22000 21027 ];
services.syncthing.guiAddress =
"${cfg.address}:${cfg.port}";
};
}