renge/grafana: Migrate to 22.11 options
This commit is contained in:
parent
60577ad4ea
commit
aa7cf807f2
|
@ -5,19 +5,28 @@ in
|
||||||
{
|
{
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
# grafana supports sockets, but no permission management (always 660 grafana:grafana)
|
# grafana supports sockets, but no permission management (always 660 grafana:grafana)
|
||||||
addr = "127.0.0.1";
|
http_addr = "127.0.0.1";
|
||||||
port = 3002;
|
http_port = 3002;
|
||||||
domain = "grafana.sbruder.de";
|
domain = "grafana.sbruder.de";
|
||||||
rootUrl = "https://%(domain)s/";
|
rootUrl = "https://%(domain)s/";
|
||||||
|
};
|
||||||
database = {
|
database = {
|
||||||
type = "postgres";
|
type = "postgres";
|
||||||
host = "/run/postgresql";
|
host = "/run/postgresql";
|
||||||
user = "grafana";
|
user = "grafana";
|
||||||
};
|
};
|
||||||
|
analytics = {
|
||||||
|
reporting_enabled = false;
|
||||||
|
check_for_updates = false;
|
||||||
|
check_for_plugin_updates = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
provision = {
|
provision = {
|
||||||
enable = true;
|
enable = true;
|
||||||
datasources = [
|
datasources.settings.datasources = [
|
||||||
{
|
{
|
||||||
name = "Prometheus";
|
name = "Prometheus";
|
||||||
type = "prometheus";
|
type = "prometheus";
|
||||||
|
@ -26,18 +35,17 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
analytics.reporting.enable = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.grafana.after = [ "postgresql.service" ];
|
systemd.services.grafana.after = [ "postgresql.service" ];
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = [ cfg.database.name ];
|
ensureDatabases = [ cfg.settings.database.name ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
name = cfg.database.user;
|
name = cfg.settings.database.user;
|
||||||
ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
|
ensurePermissions = { "DATABASE ${cfg.settings.database.name}" = "ALL PRIVILEGES"; };
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -47,7 +55,7 @@ in
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
locations = {
|
locations = {
|
||||||
"/".proxyPass = "http://${cfg.addr}:${toString cfg.port}";
|
"/".proxyPass = "http://${cfg.settings.server.http_addr}:${toString cfg.settings.server.http_port}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue