puter/hosts/abacus/syncthing.nix
2024-08-20 23:06:39 +02:00

26 lines
564 B
Nix

{config, ...}: let
inherit (config.networking) domain;
virtualHostName = "sync.${domain}";
in {
services.syncthing = {
enable = true;
systemService = true;
openDefaultPorts = true;
guiAddress = "localhost:8040";
};
services.nginx.virtualHosts.${virtualHostName} = {
enableACME = true;
forceSSL = true;
quic = true;
locations."/" = {
proxyPass = "http://${config.services.syncthing.guiAddress}";
extraConfig = ''
proxy_set_header Host ${config.services.syncthing.guiAddress};
'';
};
};
}