Files
dotfiles/nixos/syncthing.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

2026-04-26 22:31:34 -07:00
{
makeEnable,
config,
...
}: let
shared = import ../nix-shared/syncthing.nix;
inherit (shared) devices allDevices;
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";
};
};
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-08-03 21:48:13 -06:00
};
2023-08-03 21:26:28 -06:00
};
2026-04-26 22:31:34 -07:00
}