nixos-config/services/postgresql/default.nix

31 lines
586 B
Nix
Raw Normal View History

2024-11-19 07:26:32 +00:00
{
config,
pkgs,
lib,
...
}:
{
imports = [
./pgbouncer.nix
];
services.postgresql = {
enable = true;
enableJIT = true;
enableTCPIP = true;
package = pkgs.postgresql_17_jit;
authentication = lib.mkForce ''
local all all trust
host all all 127.0.0.1 scram-sha-256
'';
};
services.postgresqlBackup = {
compression = "zstd";
compressionLevel = 19;
enable = true;
};
environment.persistence."/persistent".directories = [
"${config.postgresql.dataDir}"
"${config.postgresqlLocation.location}"
];
}