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-02-02 21:34:19 +01:00
|
|
|
listenAddress = "0.0.0.0";
|
2022-01-15 21:50:42 +01:00
|
|
|
};
|
2023-01-21 16:56:01 +01:00
|
|
|
networking.firewall.interfaces."wg0".allowedTCPPorts = [9187 5432];
|
2022-01-15 21:12:12 +01:00
|
|
|
}
|