making grafana work

This commit is contained in:
quitte 2024-04-29 15:09:56 +02:00
parent 795e3db47f
commit 7526b9273b
2 changed files with 47 additions and 18 deletions

View file

@ -83,6 +83,7 @@
./modules/hedgedoc.nix
./modules/padlist.nix
./modules/nextcloud.nix
./modules/monitoring.nix
./modules/vaultwarden.nix
./modules/forgejo
./modules/kanboard.nix

View file

@ -1,11 +1,39 @@
{ config, pkgs, ... }:
let
let
domain = "monitoring.${config.networking.domain}";
in {
in
{
# grafana configuration
services.grafana = {
enable = true;
port = 2342;
settings = {
server = {
inherit domain;
http_addr = "127.0.0.1";
http_port = 2342;
};
database = {
type = "postgres";
user = "grafana";
host = "/run/postgresql";
};
};
};
services.postgresql = {
enable = true;
ensureUsers = [
{
name = "grafana";
ensurePermissions = {
"DATABASE grafana" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [ "grafana" ];
};
services.prometheus = {