summary refs log tree commit diff stats
path: root/modules/syncthing.nix
blob: cf213b2384397ae4509ae6733a293db5063793a6 (plain) (blame)
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
{ pkgs, libs, config, ... }:
{

  services.syncthing = {
    enable = true;
    guiAddress = "localhost:8384";
    dataDir = "/var/lib/syncthing";
    openDefaultPorts = true;
  };
  
  services.nginx.virtualHosts."syncthing.krinitsin.com" = {
    forceSSL = true;
    useACMEHost = "krinitsin.com";
    locations."/".proxyPass = "https://localhost:8384";
  };

  security.acme.certs."krinitsin.com".extraDomainNames = [ "syncthing.krinitsin.com" ];

  services.monit.config = ''
    check process syncthing with matching "syncthing"
    start program = "${pkgs.systemd}/bin/systemctl start syncthing"
    stop program = "${pkgs.systemd}/bin/systemctl stop syncthing"
  '';

}