mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-13 10:00:52 -06:00
31 lines
784 B
Nix
Executable file
31 lines
784 B
Nix
Executable file
{ flake, config, ... }:
|
|
let
|
|
inherit (flake.config.services) instances;
|
|
serviceCfg = instances.photoprism;
|
|
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 http://${interface0Cfg.microvm.ip}:80 {
|
|
header_up X-Forwarded-Proto {scheme}
|
|
header_up X-Real-IP {remote_host}
|
|
header_up X-Forwarded-For {remote_host}
|
|
}
|
|
|
|
tls ${interface0Cfg.ssl.cert} ${interface0Cfg.ssl.key}
|
|
|
|
encode zstd gzip
|
|
'';
|
|
};
|
|
|
|
}
|