2024-10-04 18:30:45 +02:00
|
|
|
{
|
2024-11-08 18:23:40 +01:00
|
|
|
username,
|
|
|
|
domain,
|
|
|
|
...
|
|
|
|
}: {
|
2024-10-23 21:31:27 +02:00
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
2024-11-08 18:23:40 +01:00
|
|
|
dataDir = "/home/${username}";
|
2024-10-23 21:31:27 +02:00
|
|
|
openDefaultPorts = true;
|
2024-11-08 18:23:40 +01:00
|
|
|
configDir = "/home/${username}/.config/syncthing";
|
|
|
|
user = username;
|
2024-10-23 21:31:27 +02:00
|
|
|
group = "users";
|
|
|
|
guiAddress = "0.0.0.0:8384";
|
|
|
|
};
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
2024-11-08 18:23:40 +01:00
|
|
|
virtualHosts."sync.${domain}" = {
|
2024-10-23 21:31:27 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:8384";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
extraConfig =
|
|
|
|
"proxy_ssl_server_name on;"
|
|
|
|
+ "proxy_pass_header Authorization;";
|
|
|
|
};
|
2024-08-31 16:04:57 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|