Skip to content

syncthing

Syncthing is a continuous file synchronization program with automatic peer discovery

Utility
System
Network

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
{
  phone = {
    id = "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2";
    name = "My Phone";
    addresses = [ "dynamic" ];
  };
}

Declared in: clanServices/syncthing/default.nix

extraDevices.<name>.addresses

List of addresses for the device

Type: list of string

Default:

[
  "dynamic"
]
Example
[
  "dynamic"
  "tcp://192.168.1.100:22000"
]

Declared in: clanServices/syncthing/default.nix

extraDevices.<name>.id

Device ID of the external syncthing device

Type: string

Example
"P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2"

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:

false

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:

3600

Declared in: clanServices/syncthing/default.nix

folders.<name>.type

Folder type

Type: one of "sendreceive", "sendonly", "receiveonly"

Default:

"sendreceive"

Declared in: clanServices/syncthing/default.nix

folders.<name>.versioning

Versioning configuration

Type: null or (submodule)

Default:

null

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:

true

Declared in: clanServices/syncthing/default.nix