nixos-config/config/services/postgres.nix

26 lines
618 B
Nix
Raw Normal View History

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;
2023-02-04 12:26:05 +00:00
authentication = "host all all fd7a:115c:a1e0:ab12::/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";
2023-02-02 20:34:19 +00:00
listenAddress = "0.0.0.0";
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
}