aboutsummaryrefslogtreecommitdiff
path: root/modules/syncthing/default.nix
blob: 2136a49414f3bcb5e943b904ec43497f313fd0c0 (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
41
42
43
44
45
{
  config,
  lib,
  pkgs,
  ...
}:

{
  services.syncthing = {
    enable = true;
    # Open ports in the firewall for Syncthing. (NOTE: this will not open syncthing gui port)
    openDefaultPorts = true;
    key = "/run/secrets/syncthing/key.pem";
    cert = "/run/secrets/syncthing/cert.pem";

    settings = {
      devices = {
        "ffm0089" = {
          id = "D5LYWQQ-GRV6QOK-RXYD32P-YNNFU3C-C7XOEY2-EWHCWSQ-3XC4CHG-EWMOMQZ";
        };
        # "liduur" = { id = "DEVICE-ID-GOES-HERE"; };
      };
      folders = {
        ".org" = {
          path = "/home/audron/.org";
          devices = [
            "ffm0089"
            # "liduur"
          ];
        };
      };
    };
  };

  secrets = {
    syncthingKey = {
      source = ../../secrets/syncthing/key.pem;
      dest = config.services.syncthing.key;
    };
    syncthingCert = {
      source = ../../secrets/syncthing/cert.pem;
      dest = config.services.syncthing.cert;
    };
  };
}