2023-08-03 21:26:28 -06:00
|
|
|
{ pkgs, ... }:
|
2023-08-03 22:10:40 -06:00
|
|
|
let
|
|
|
|
devices = {
|
2023-08-03 23:08:00 -06:00
|
|
|
biskcomp = {
|
|
|
|
id = "PVGY6OH-WJEA5SD-SL5YI3F-72AZKVL-ZXHIWEW-D5V245P-VUM2BST-CH47JQD";
|
|
|
|
addresses = [ "tcp://192.168.1.44:22000" "tcp://1896Folsom.duckdns.org:22000" ];
|
|
|
|
};
|
2023-08-03 22:10:40 -06:00
|
|
|
ryzen-shine = { id = "IYCR3JH-BDZ4N3F-ZBUETYR-4N2UILK-FAEJJ5B-YUYMZQ3-YN63E5T-I2EHCAK"; };
|
|
|
|
nixquick = { id = "6OAGJ3J-3P3R33R-ICHXDWX-IDDCUU7-ESN3Y65-2OGZMWL-R647V7N-4TA6IQM"; };
|
2023-08-03 23:08:00 -06:00
|
|
|
pixel-7-pro = { id = "RZGPHX3-W5BPHLT-I4VLQVI-ZW4K7CE-X525NEN-XRG6MOH-GPEUXAD-4VG3XAR"; };
|
2023-08-03 22:10:40 -06:00
|
|
|
};
|
|
|
|
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 23:12:26 -06:00
|
|
|
options = {
|
|
|
|
relaysEnabled = true;
|
|
|
|
localAnnounceEnabled = true;
|
|
|
|
};
|
2023-08-03 21:26:28 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|