{ moduleFunctions }:
let
  inherit (moduleFunctions.instancesFunctions)
    domain0
    varLib
    sslPath
    sopsPath
    ;

  label = "Syncthing";
  name = "syncthing";
  domain = "${name}.${domain0}";
in
{
  label = label;
  name = name;
  short = "Sync";
  sops = {
    path0 = "${sopsPath}/${name}";
  };
  paths = {
    path0 = "${varLib}/${name}";
    path1 = "${varLib}/${name}/backups";
  };
  domains = {
    url0 = domain;
  };
  subdomain = name;
  tags = [
    name
    "sync"
    "thing"
  ];
  ports = {
    port0 = 8384; # Syncthing (WebUI)
    port1 = 21027; # Syncthing (Discovery)
    port2 = 22000; # Syncthing (Transfer)
  };
  ssl = {
    cert = "${sslPath}/${name}.${domain0}/fullchain.pem";
    key = "${sslPath}/${name}.${domain0}/key.pem";
  };
}
