Server: add grafana

This commit is contained in:
Toast 2025-01-08 13:50:10 +01:00
parent a2bce9715d
commit 88235bb32e
2 changed files with 31 additions and 0 deletions

30
roles/server/grafana.nix Normal file
View file

@ -0,0 +1,30 @@
{config, ...}: let
domain = "monitoring.everest.tailscale";
in {
users.users.caddy.extraGroups = ["grafana"];
services = {
grafana = {
enable = true;
settings = {
server = {
protocol = "socket";
};
};
};
headscale.settings.dns.extra_records = [
{
name = domain;
type = "A";
value = "100.100.0.1";
}
];
caddy.virtualHosts.grafana = {
hostName = domain;
extraConfig = ''
import tailscale
reverse_proxy unix/${config.services.grafana.settings.server.socket}
'';
};
};
}