Server: add grafana
This commit is contained in:
parent
a2bce9715d
commit
88235bb32e
2 changed files with 31 additions and 0 deletions
30
roles/server/grafana.nix
Normal file
30
roles/server/grafana.nix
Normal 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}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue