45 lines
1.4 KiB
Nix
45 lines
1.4 KiB
Nix
#
|
|
# System notifications
|
|
#
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
services.postgresql = {
|
|
enable = true;
|
|
package = pkgs.postgresql_14;
|
|
settings = {
|
|
max_connections = 200;
|
|
listen_addresses = "localhost";
|
|
password_encryption = "scram-sha-256";
|
|
shared_buffers = "512MB";
|
|
work_mem = "8MB";
|
|
autovacuum_work_mem = -1;
|
|
min_wal_size = "1GB";
|
|
max_wal_size = "4GB";
|
|
log_timezone = "Europe/Berlin";
|
|
timezone = "Europe/Berlin";
|
|
};
|
|
authentication = pkgs.lib.mkOverride 14 ''
|
|
local all postgres peer
|
|
host giteadb gitea localhost scram-sha-256
|
|
host woodpeckerdb woodpecker localhost scram-sha-256
|
|
host nextclouddb nextcloud localhost scram-sha-256
|
|
host synapsedb synapse localhost scram-sha-256
|
|
host whatsappdb mautrixwa localhost scram-sha-256
|
|
host telegramdb mautrixtele localhost scram-sha-256
|
|
host signaldb mautrixsignal localhost scram-sha-256
|
|
host keycloakdb keycloak localhost scram-sha-256
|
|
'';
|
|
initialScript = config.age.secrets."services/postgresql/initScript.sql".path;
|
|
};
|
|
|
|
services.postgresqlBackup.enable = true;
|
|
|
|
age.secrets."services/postgresql/initScript.sql" = {
|
|
file = ../../../secrets/services/postgresql/initScript.age;
|
|
owner = "postgres";
|
|
};
|
|
|
|
}
|