syncthing
Syncthing is a continuous file synchronization program with automatic peer discovery
This service configures Syncthing to continuously synchronize a folder peer-to-peer across your machines.
Example configuration:
{
instances.syncthing = {
roles.peer.tags.all = { };
roles.peer.settings.folders = {
documents = {
path = "/home/youruser/syncthing/documents";
};
};
};
}
Notes:
- Each key under folders is a folder ID (an arbitrary identifier for Syncthing).
- Prefer absolute paths (example shown). ~ may work in some environments but can be ambiguous in service contexts.
Documentation
See the official Syncthing docs: https://docs.syncthing.net/
Roles
The syncthing service has the following roles:
- peer
Options for the peer role
extraDevices
External syncthing devices not managed by clan (e.g., mobile phones)
Type: attribute set of (submodule)
Default:
Example
Declared in: clanServices/syncthing/default.nix
extraDevices.<name>.addresses
List of addresses for the device
Type: list of string
Default:
Declared in: clanServices/syncthing/default.nix
extraDevices.<name>.id
Device ID of the external syncthing device
Type: string
Declared in: clanServices/syncthing/default.nix
extraDevices.<name>.name
Human readable name for the device
Type: string
Default:
Declared in: clanServices/syncthing/default.nix
folders
Folders to synchronize between all peers
Type: attribute set of (submodule)
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.devices
List of device names to share this folder with. Empty list means all peers and extraDevices.
Type: list of string
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.ignorePerms
Ignore permission changes
Type: boolean
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.path
Path to the folder to sync
Type: string
Declared in: clanServices/syncthing/default.nix
folders.<name>.rescanIntervalS
Rescan interval in seconds
Type: signed integer
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.type
Folder type
Type: one of "sendreceive", "sendonly", "receiveonly"
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.versioning
Versioning configuration
Type: null or (submodule)
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.versioning.params
Versioning parameters
Type: attribute set of string
Default:
Declared in: clanServices/syncthing/default.nix
folders.<name>.versioning.type
Versioning type
Type: one of "external", "simple", "staggered", "trashcan"
Declared in: clanServices/syncthing/default.nix
openDefaultPorts
Whether to open the default syncthing ports in the firewall.
Type: boolean
Default:
Declared in: clanServices/syncthing/default.nix