Skip to content

syncthing 🔹

A secure, file synchronization app for devices over networks, offering a private alternative to cloud services.

Categories

Uncategorized

Warning: This module was written with our VM integration in mind likely won't work outside of this context. They will be generalized in future.

Usage

We recommend configuring this module as an sync-service through the provided options. Although it provides a Web GUI through which more usage scenarios are supported.

Features

  • Private and Secure: Syncthing uses TLS encryption to secure data transfer between devices, ensuring that only the intended devices can read your data.
  • Decentralized: No central server is involved in the data transfer. Each device communicates directly with others.
  • Open Source: The source code is openly available for audit and contribution, fostering trust and continuous improvement.
  • Cross-Platform: Syncthing supports multiple platforms including Windows, macOS, Linux, BSD, and Android.
  • Real-time Synchronization: Changes made to files are synchronized in real-time across all connected devices.
  • Web GUI: It includes a user-friendly web interface for managing devices and configurations. (127.0.0.1:8384)

Configuration

  • Share Folders: Select folders to share with connected devices and configure permissions and synchronization parameters.

Info

Clan automatically discovers other devices. Automatic discovery requires one machine to be an introducer

If that is not the case you can add the other device by its Device ID manually. You can find and share Device IDs under the "Add Device" button in the Web GUI. (127.0.0.1:8384)

Troubleshooting

  • Sync Conflicts: Resolve synchronization conflicts manually by reviewing file versions and modification times in the Web GUI (127.0.0.1:8384).

Support

Usage via Inventory

Roles

This module can be used via predefined roles

- `peer`
- `introducer`

Every role has its own configuration options. Which are each listed below.

For more information, see the inventory guide.

Example

For example the admin module adds the following options globally to all machines where it is used.

clan.admin.allowedkeys

This means there are two equivalent ways to set the allowedkeys option. Either via a nixos module or via the inventory interface. But it is recommended to keep together imports and config to preserve locality of the module configuration.

clan-core.lib.buildClan {
    inventory.services = {
        admin.me = {
            roles.default.machines = [ "jon" ];
            config.allowedkeys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD..." ];
        };
    };
};
clan-core.lib.buildClan {
    machines = {
        jon = {
            clan.admin.allowedkeys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD..." ];
            imports = [ clanModules.admin ];
        };
    };
};

Options of peer role

The following options are available when using the peer role.

autoAcceptDevices

Auto accept incoming device requests. Should only be used on the introducer.

Type: boolean

Default:

false

shared.nix

autoShares

Auto share the following Folders by their ID's with introduced devices. Should only be used on the introducer.

Type: list of string

Default:

[ ]
Example
[
  "folder1"
  "folder2"
]

shared.nix

id

The ID of the machine. It is generated automatically by default.

Type: null or string

Default:

"config.clan.core.vars.generators.syncthing.files.\"id\".value"
Example
"BABNJY4-G2ICDLF-QQEG7DD-N3OBNGF-BCCOFK6-MV3K7QJ-2WUZHXS-7DTW4AS"

shared.nix

introducer

The introducer for the machine.

Type: null or string

Default:

null

shared.nix

Options of introducer role

The following options are available when using the introducer role.

autoAcceptDevices

Auto accept incoming device requests. Should only be used on the introducer.

Type: boolean

Default:

false

shared.nix

autoShares

Auto share the following Folders by their ID's with introduced devices. Should only be used on the introducer.

Type: list of string

Default:

[ ]
Example
[
  "folder1"
  "folder2"
]

shared.nix

id

The ID of the machine. It is generated automatically by default.

Type: null or string

Default:

"config.clan.core.vars.generators.syncthing.files.\"id\".value"
Example
"BABNJY4-G2ICDLF-QQEG7DD-N3OBNGF-BCCOFK6-MV3K7QJ-2WUZHXS-7DTW4AS"

shared.nix

introducer

The introducer for the machine.

Type: null or string

Default:

null

shared.nix

Usage via Nix

This module can be also imported directly in your nixos configuration. Although it is recommended to use the inventory interface if available.

Some modules are considered 'low-level' or 'expert modules' and are not available via the inventory interface.

{config, lib, inputs, ...}: {
    imports = [ inputs.clan-core.clanModules.syncthing ];
    # ...
}

Module Options

The following options are available for this module.

clan.syncthing.autoAcceptDevices

Auto accept incoming device requests. Should only be used on the introducer.

Type: boolean

Default:

false

shared.nix

clan.syncthing.autoShares

Auto share the following Folders by their ID's with introduced devices. Should only be used on the introducer.

Type: list of string

Default:

[ ]
Example
[
  "folder1"
  "folder2"
]

shared.nix

clan.syncthing.id

The ID of the machine. It is generated automatically by default.

Type: null or string

Default:

"config.clan.core.vars.generators.syncthing.files.\"id\".value"
Example
"BABNJY4-G2ICDLF-QQEG7DD-N3OBNGF-BCCOFK6-MV3K7QJ-2WUZHXS-7DTW4AS"

shared.nix

clan.syncthing.introducer

The introducer for the machine.

Type: null or string

Default:

null

shared.nix