{config, pkgs, ...}:

{
  services.nix-serve = {
    enable = true;
    port = 5050;
    secretKeyFile = "/etc/nixos/secrets/cache-priv-key.pem";
  };
  services.caddy.virtualHosts = {
    "nixcache.syzygial.cc" = {
      extraConfig = ''
        reverse_proxy 127.0.0.1:${toString config.services.nix-serve.port}
      '';
    };
  };
}
