mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-13 10:00:52 -06:00
35 lines
816 B
Nix
Executable file
35 lines
816 B
Nix
Executable file
{
|
|
config,
|
|
flake,
|
|
...
|
|
}:
|
|
let
|
|
inherit (flake.config.services) instances;
|
|
serviceCfg = instances.syncthing;
|
|
interface0Cfg = serviceCfg.interfaces.interface0;
|
|
host0 = interface0Cfg.domain;
|
|
dns0 = instances.web.dns.provider0;
|
|
dns0Path = "dns/${dns0}";
|
|
in
|
|
{
|
|
security.acme.certs."${host0}" = {
|
|
dnsProvider = dns0;
|
|
environmentFile = config.sops.secrets.${dns0Path}.path;
|
|
group = "caddy";
|
|
};
|
|
services = {
|
|
caddy = {
|
|
virtualHosts = {
|
|
"${host0}" = {
|
|
extraConfig = ''
|
|
reverse_proxy ${interface0Cfg.microvm.ip}:${toString serviceCfg.ports.port0} {
|
|
header_up X-Real-IP {remote_host}
|
|
}
|
|
tls ${interface0Cfg.ssl.cert} ${interface0Cfg.ssl.key}
|
|
encode zstd gzip
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|