2023-08-03 21:26:28 -06:00
|
|
|
{ pkgs, ... }:
|
2023-08-03 22:10:40 -06:00
|
|
|
let
|
|
|
|
devices = {
|
|
|
|
ryzen-shine = { id = "IYCR3JH-BDZ4N3F-ZBUETYR-4N2UILK-FAEJJ5B-YUYMZQ3-YN63E5T-I2EHCAK"; };
|
2023-08-03 22:19:54 -06:00
|
|
|
biskcomp = { id = "PVGY6OH-WJEA5SD-SL5YI3F-72AZKVL-ZXHIWEW-D5V245P-VUM2BST-CH47JQD"; };
|
2023-08-03 22:10:40 -06:00
|
|
|
nixquick = { id = "6OAGJ3J-3P3R33R-ICHXDWX-IDDCUU7-ESN3Y65-2OGZMWL-R647V7N-4TA6IQM"; };
|
|
|
|
};
|
|
|
|
allDevices = builtins.attrNames devices;
|
|
|
|
in
|
2023-08-03 21:26:28 -06:00
|
|
|
{
|
2023-08-03 22:01:56 -06:00
|
|
|
system.activationScripts.syncthingPermissions = {
|
|
|
|
text = ''
|
|
|
|
chown -R syncthing:syncthing /var/lib/syncthing
|
|
|
|
chmod -R 2770 /var/lib/syncthing
|
|
|
|
mkdir -p /var/lib/syncthing/sync
|
|
|
|
'';
|
|
|
|
};
|
2023-08-03 21:26:28 -06:00
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2023-08-03 22:10:40 -06:00
|
|
|
inherit devices;
|
2023-08-03 21:48:13 -06:00
|
|
|
folders = {
|
|
|
|
sync = {
|
2023-08-03 22:01:56 -06:00
|
|
|
path = "~/sync";
|
2023-08-03 22:10:40 -06:00
|
|
|
devices = allDevices;
|
2023-08-03 21:48:13 -06:00
|
|
|
};
|
|
|
|
};
|
2023-08-03 21:26:28 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|