2022-06-12 15:39:15 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
2022-01-15 20:42:50 +00:00
|
|
|
services.postgresql = {
|
2022-01-15 20:12:12 +00:00
|
|
|
enable = true;
|
|
|
|
enableTCPIP = true;
|
2022-01-15 20:46:08 +00:00
|
|
|
authentication = "host all all fd0d:a262:1fa6:e621::/64 md5";
|
2022-05-02 09:47:56 +00:00
|
|
|
settings = {
|
|
|
|
shared_preload_libraries = "pg_stat_statements";
|
|
|
|
"pg_stat_statements.track" = "all";
|
|
|
|
};
|
2022-01-15 20:12:12 +00:00
|
|
|
};
|
2022-01-15 20:58:11 +00:00
|
|
|
services.postgresqlBackup = {
|
|
|
|
enable = true;
|
|
|
|
compression = "none"; # the file system and restic both do compression
|
|
|
|
};
|
2022-01-15 20:50:42 +00:00
|
|
|
services.prometheus.exporters.postgres = {
|
|
|
|
enable = true;
|
2022-01-15 20:53:08 +00:00
|
|
|
user = "postgres";
|
2022-12-16 07:26:04 +00:00
|
|
|
listenAddress = (import ../../utils/getInternalIP.nix config).listenIP;
|
2022-01-15 20:50:42 +00:00
|
|
|
};
|
2023-01-21 15:56:01 +00:00
|
|
|
networking.firewall.interfaces."wg0".allowedTCPPorts = [9187 5432];
|
2022-01-15 20:12:12 +00:00
|
|
|
}
|