mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
25 lines
624 B
Nix
25 lines
624 B
Nix
{ 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}";
|
|
};
|
|
}
|