{ config, lib, ... }:
let
  umamiPort = 5782;
in
{
  config = lib.mkMerge [
    (lib.mkIf (config.networking.hostName == "nixnas") {
      services.umami = {
        enable = true;
        settings = {
          APP_SECRET_FILE = "/Block/umami/app_secret.txt";
          HOSTNAME = "127.0.0.1";
          PORT = umamiPort;
        };
      };
      services.cloudflared.tunnels.mine.ingress."umami.claytonhickey.me" = "http://127.0.0.1:${builtins.toString umamiPort}";
    })
  ];
}
