nixos-config/config/services/postgres.nix

21 lines
587 B
Nix
Raw Normal View History

2022-01-15 20:50:42 +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-01-15 20:50:42 +00:00
listenAddress = (import ../../utils/getInternalIP.nix config).listenIP;
};
2022-01-15 20:12:12 +00:00
}