.dotfiles/profiles/server/common/monitoring.nix
2024-10-23 11:15:41 +02:00

43 lines
916 B
Nix

{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.swarselsystems.server.monitoring {
sops.secrets = {
grafanaadminpass = {
owner = "grafana";
}
}
users.users.grafana = {
extraGroups = [ "users" ];
};
services.grafana = {
enable = true;
dataDir = "/Vault/data/grafana";
admin_password = "$__file{/run/secrets/grafanaadminpass}";
settings = {
http_port = 3000;
http_addr = "127.0.0.1";
};
};
services.nginx = {
virtualHosts = {
"status.swarsel.win" = {
enableACME = true;
forceSSL = true;
acmeRoot = null;
locations = {
"/" = {
proxyPass = "http://localhost:3000/";
extraConfig = ''
client_max_body_size 0;
'';
};
};
};
};
};
};
}