mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-19 19:30:28 +05:00
chore: migrate grafana to postgres database
This commit is contained in:
parent
ab3c57c29e
commit
84b4c2b0a7
|
@ -7,6 +7,12 @@
|
|||
http_port = 55010;
|
||||
domain = "grafana.comfycamp.space";
|
||||
};
|
||||
database = {
|
||||
user = "grafana";
|
||||
type = "postgres";
|
||||
name = "grafana";
|
||||
host = "/var/run/postgresql";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
config.services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_15;
|
||||
ensureDatabases = [ "mastodon" "matrix-synapse" "nextcloud" "maddy" "plausible" "microboard" "freshrss" "prosody" ];
|
||||
ensureDatabases = [ "mastodon" "matrix-synapse" "nextcloud" "maddy" "plausible" "microboard" "freshrss" "prosody" "grafana" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "mastodon";
|
||||
|
@ -61,6 +61,13 @@
|
|||
};
|
||||
ensureClauses.login = true;
|
||||
}
|
||||
{
|
||||
name = "grafana";
|
||||
ensurePermissions = {
|
||||
"DATABASE grafana" = "ALL PRIVILEGES";
|
||||
};
|
||||
ensureClauses.login = true;
|
||||
}
|
||||
];
|
||||
initialScript = pkgs.writeText "pg-init.sql" ''
|
||||
ALTER DATABASE nextcloud OWNER TO nextcloud;
|
||||
|
@ -71,6 +78,7 @@
|
|||
ALTER DATABASE microboard OWNER TO microboard;
|
||||
ALTER DATABASE freshrss OWNER TO freshrss;
|
||||
ALTER DATABASE prosody OWNER TO prosody;
|
||||
ALTER DATABASE grafana OWNER TO grafana;
|
||||
'';
|
||||
identMap = ''
|
||||
# ArbitraryMapName systemUser DBUser
|
||||
|
|
Loading…
Reference in a new issue