blob: 951ad30053d3ba9f50b2ce1ccd52371a9cb25d9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
{
config,
lib,
...
}:
with lib; let
cfg = config.local.syncthing;
in {
options.local.syncthing = {
enable = mkEnableOption "syncthing server";
openFirewall = mkEnableOption "syncthing firewall rules";
};
config = mkMerge [
{
networking.firewall = {
allowedTCPPorts = optional cfg.openFirewall 22000;
allowedUDPPorts = optional cfg.openFirewall 22000;
};
}
(mkIf cfg.enable {
local.syncthing.openFirewall = true;
services.syncthing = {
enable = true;
systemService = true;
overrideFolders = false;
overrideDevices = false;
openDefaultPorts = true;
guiAddress = "127.0.0.1:8384";
settings.options.urAccepted = -1;
relay = {
enable = true;
pools = [];
providedBy = "${config.networking.hostName}.${config.networking.domain}";
};
};
})
];
}
|