summary refs log tree commit diff
path: root/mixins/syncthing.nix
blob: 8928969b974fa5f544ed12904f04aee8a0555e0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  pkgs,
  config,
  ...
}: {
  config = {
    services.syncthing = {
      enable = true;
      user = "tzlil";
      dataDir = "/home/tzlil/sync";
      configDir = "/home/tzlil/.config/syncthing";
      overrideDevices = true;
      overrideFolders = true;
      settings = {
        devices = {
          "phone".id = "UHWVTEZ-BERNFCH-3ZXQHNE-ZRBHLU6-MBAVEHB-TKLQJM7-ZGHLJ4R-6E4SAA7";
        };
        folders = {
          "passwords" = {
            path = "/home/tzlil/sync/passwords";
            devices = ["phone"];
          };
        };
      };
    };

    environment.persistence."/nix/persist".directories = [
      {
        directory = "/home/tzlil/sync";
        user = "tzlil";
        group = "users";
      }
      {
        directory = "/home/tzlil/.config/syncthing";
        user = "tzlil";
        group = "users";
      }
    ];
  };
}