mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-13 10:00:52 -06:00
26 lines
710 B
Nix
Executable file
26 lines
710 B
Nix
Executable file
{ flake, config, ... }:
|
|
let
|
|
inherit (flake.config.services) instances;
|
|
serviceCfg = instances.forgejo;
|
|
dns0 = instances.web.dns.provider0;
|
|
dns0Path = "dns/${dns0}";
|
|
interface0Cfg = serviceCfg.interfaces.interface0;
|
|
host0 = interface0Cfg.domain;
|
|
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
|
|
'';
|
|
};
|
|
}
|