2023-11-28 15:21:03 +01:00
|
|
|
# https://nixos.wiki/wiki/Syncthing
|
|
|
|
|
|
|
|
# Manually create syncthing.folders.<name>.path and chown it to user/group `syncthing`
|
|
|
|
# before starting the Syncthing service.
|
|
|
|
|
|
|
|
# You can get your device id with:
|
|
|
|
# sudo cat /var/lib/syncthing/.config/syncthing/config.xml | grep 'device id="'
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
services = {
|
|
|
|
syncthing = {
|
|
|
|
enable = true;
|
|
|
|
# Whether to open the default ports in the firewall: TCP/UDP 22000 for transfers and UDP 21027 for discovery.
|
2023-12-12 16:40:31 +01:00
|
|
|
# With this enabled, the connection type of other syncthing clients in the same WiFi/LAN is "TCP LAN" and not "WAN Relay".
|
|
|
|
openDefaultPorts = true;
|
2023-11-28 15:21:03 +01:00
|
|
|
overrideDevices = true; # overrides any devices added or deleted through the WebUI
|
|
|
|
overrideFolders = true; # overrides any folders added or deleted through the WebUI
|
|
|
|
devices = {
|
|
|
|
"yodaTux" = { id = "AKAIZ66-G67WC4J-WEYBOGF-TNXWBT3-BCSETRQ-2BEHCT7-GSZQRWP-IGXKSQK"; };
|
2023-11-29 15:00:54 +01:00
|
|
|
"yodaTab" = { id = "WKVVVEY-P7QCRKU-HO4QHHM-B4H5NC2-I3UG2TU-UEIUACZ-ZJEAVUY-4Q6FVQV"; };
|
2023-12-19 21:50:39 +01:00
|
|
|
"yodaEnchilada" = { id = "UZKPAHU-CSLMDX2-4RYQLG2-WENUTZY-HM3RUD4-N7VIG7W-RFLAQHP-OXA7MQT"; };
|
2023-11-28 15:21:03 +01:00
|
|
|
"yodaCheeseburger" = { id = "KHR22KP-WK6EL25-Z3DPLZK-5IHU7BC-QYXFQJA-U7JE2JA-ITYNV3Q-JE5VKAJ"; };
|
|
|
|
};
|
|
|
|
folders = {
|
|
|
|
# Name of folder in Syncthing, also the folder ID.
|
|
|
|
"Notes" = {
|
|
|
|
# Path to shared folder.
|
|
|
|
path = "/mnt/data/syncthing/notes";
|
|
|
|
# Which devices to share the folder with.
|
2023-11-29 15:00:54 +01:00
|
|
|
devices = [ "yodaTux" "yodaTab" "yodaEnchilada" "yodaCheeseburger" ];
|
2023-11-28 15:21:03 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|