{ config, ... }:
let
  domain = "cache.rfive.de";
in
{
  age.secrets.cache = {
    file = ../../../../secrets/nuc/cache.age;
  };
  services.nix-serve = {
    enable = true;
    secretKeyFile = config.age.secrets.cache.path;
  };
  services.caddy.virtualHosts."${domain}".extraConfig = ''
    reverse_proxy 127.0.0.1:${toString config.services.nix-serve.port}
  '';
}
