2022-06-12 16:39:15 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
2022-01-15 21:42:50 +01:00
|
|
|
services.postgresql = {
|
2022-01-15 21:12:12 +01:00
|
|
|
enable = true;
|
|
|
|
enableTCPIP = true;
|
2023-02-04 13:26:05 +01:00
|
|
|
authentication = "host all all fd7a:115c:a1e0:ab12::/64 md5";
|
2022-05-02 10:47:56 +01:00
|
|
|
settings = {
|
|
|
|
shared_preload_libraries = "pg_stat_statements";
|
|
|
|
"pg_stat_statements.track" = "all";
|
|
|
|
};
|
2022-01-15 21:12:12 +01:00
|
|
|
};
|
2022-01-15 21:58:11 +01:00
|
|
|
services.postgresqlBackup = {
|
|
|
|
enable = true;
|
|
|
|
compression = "none"; # the file system and restic both do compression
|
|
|
|
};
|
2022-01-15 21:50:42 +01:00
|
|
|
services.prometheus.exporters.postgres = {
|
|
|
|
enable = true;
|
2022-01-15 21:53:08 +01:00
|
|
|
user = "postgres";
|
2023-12-10 11:41:34 +01:00
|
|
|
port = 1589;
|
2022-01-15 21:50:42 +01:00
|
|
|
};
|
2022-01-15 21:12:12 +01:00
|
|
|
}
|