summaryrefslogtreecommitdiff
path: root/profiles/core/syncthing.nix
blob: e5c19f7b9599dff9639fa564f232caa3f9b129b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{config, lib,...}: with lib; {
  services.syncthing = {
    enable = true;
    user = ivi.username;
    inherit (config.ivi) group;
    overrideDevices = true;
    overrideFolders = true;

    key = config.secrets.syncthing.path;

    settings = {
      devices = mapAttrs (_: m: {
        inherit (m.syncthing) id;
        introducer = m.isServer;
      }) (filterAttrs (_: m: m.syncthing.enable) ivi.machines);
    };
  };
}