2026-04-26 22:31:34 -07:00
|
|
|
{
|
|
|
|
|
makeEnable,
|
|
|
|
|
config,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
shared = import ../nix-shared/syncthing.nix;
|
|
|
|
|
inherit (shared) devices allDevices;
|
2023-08-03 22:10:40 -06:00
|
|
|
in
|
2026-04-26 22:31:34 -07:00
|
|
|
makeEnable config "myModules.syncthing" true {
|
|
|
|
|
system.activationScripts.syncthingPermissions = {
|
|
|
|
|
text = ''
|
|
|
|
|
chown -R syncthing:syncthing /var/lib/syncthing
|
|
|
|
|
chmod -R 2770 /var/lib/syncthing
|
|
|
|
|
mkdir -p /var/lib/syncthing/sync
|
|
|
|
|
mkdir -p /var/lib/syncthing/railbird
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
systemd.services.syncthing = {
|
|
|
|
|
serviceConfig = {
|
|
|
|
|
AmbientCapabilities = "CAP_CHOWN";
|
|
|
|
|
CapabilityBoundingSet = "CAP_CHOWN";
|
|
|
|
|
};
|
2024-03-21 15:16:11 -06:00
|
|
|
};
|
2026-04-26 22:31:34 -07:00
|
|
|
services.syncthing = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = {
|
|
|
|
|
inherit devices;
|
|
|
|
|
folders = {
|
|
|
|
|
sync = {
|
|
|
|
|
path = "~/sync";
|
|
|
|
|
devices = allDevices;
|
|
|
|
|
ignorePerms = true;
|
|
|
|
|
copyOwnershipFromParent = true;
|
|
|
|
|
};
|
|
|
|
|
railbird = {
|
|
|
|
|
path = "~/railbird";
|
|
|
|
|
devices = allDevices;
|
|
|
|
|
ignorePerms = true;
|
|
|
|
|
copyOwnershipFromParent = true;
|
|
|
|
|
};
|
2023-08-03 21:48:13 -06:00
|
|
|
};
|
2026-04-26 22:31:34 -07:00
|
|
|
options = {
|
|
|
|
|
relaysEnabled = true;
|
|
|
|
|
localAnnounceEnabled = true;
|
2023-12-21 13:26:09 -07:00
|
|
|
};
|
2023-08-03 21:48:13 -06:00
|
|
|
};
|
2023-08-03 21:26:28 -06:00
|
|
|
};
|
2026-04-26 22:31:34 -07:00
|
|
|
}
|