add grafana

This commit is contained in:
cy 2024-12-15 18:42:50 -05:00
parent 0337509664
commit ec1e45408f
3 changed files with 46 additions and 0 deletions

View file

@ -60,3 +60,7 @@ pad.cything.io {
red.cything.io {
reverse_proxy localhost:8087
}
grafana.cything.io {
reverse_proxy localhost:8088
}

View file

@ -20,6 +20,7 @@
./redlib.nix
./vaultwarden.nix
./wireguard.nix
./grafana.nix
];
sops.defaultSopsFile = ./secrets.yaml;
@ -79,11 +80,21 @@
prefixLength = 64;
}
];
ipv4.addresses = [
{
address = "31.59.129.225";
prefixLength = 24;
}
];
};
networking.defaultGateway6 = {
address = "2a0f:85c1:840::1";
interface = "ens18";
};
networking.defaultGateway = {
address = "31.59.129.1";
interface = "ens18";
};
networking.nameservers = ["127.0.0.1" "::1"];
time.timeZone = "America/Toronto";

31
hosts/chunk/grafana.nix Normal file
View file

@ -0,0 +1,31 @@
{config,...}: {
services.grafana = {
enable = true;
settings.server = {
http_addr = "127.0.0.1";
http_port = 8088;
enforce_domain = true;
enable_gzip = true;
domain = "grafana.cything.io";
};
settings.analytics.reporting_enabled = false;
};
services.prometheus = {
enable = true;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
};
};
scrapeConfigs = [
{
job_name = "chrysalis";
static_configs = [{
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
}];
}
];
};
}