2022-12-10 11:16:50 +01:00
|
|
|
#
|
|
|
|
# System notifications
|
|
|
|
#
|
|
|
|
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.postgresql_14;
|
|
|
|
settings = {
|
|
|
|
max_connections = 200;
|
2022-12-17 13:41:27 +01:00
|
|
|
listen_addresses = "localhost";
|
|
|
|
password_encryption = "scram-sha-256";
|
2024-02-12 12:34:15 +01:00
|
|
|
shared_buffers = "2GB";
|
|
|
|
work_mem = "1GB";
|
|
|
|
maintence_work_mem = "500MB"
|
2022-12-10 11:16:50 +01:00
|
|
|
autovacuum_work_mem = -1;
|
2022-12-17 13:41:27 +01:00
|
|
|
min_wal_size = "1GB";
|
|
|
|
max_wal_size = "4GB";
|
|
|
|
log_timezone = "Europe/Berlin";
|
|
|
|
timezone = "Europe/Berlin";
|
2022-12-10 11:16:50 +01:00
|
|
|
};
|
|
|
|
authentication = pkgs.lib.mkOverride 14 ''
|
2022-12-27 21:15:04 +01:00
|
|
|
local all postgres peer
|
2022-12-28 11:07:40 +01:00
|
|
|
host giteadb gitea localhost scram-sha-256
|
2023-03-14 20:02:51 +01:00
|
|
|
host woodpeckerdb woodpecker localhost scram-sha-256
|
2022-12-28 11:07:40 +01:00
|
|
|
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
|
2024-02-12 12:25:27 +01:00
|
|
|
host onlyoffice onlyoffice localhost scram-sha-256
|
|
|
|
local onlyoffice onlyoffice peer
|
2022-12-17 13:41:27 +01:00
|
|
|
'';
|
2022-12-27 20:52:04 +01:00
|
|
|
initialScript = config.age.secrets."services/postgresql/initScript.sql".path;
|
2022-12-10 11:16:50 +01:00
|
|
|
};
|
|
|
|
|
2022-12-17 13:41:27 +01:00
|
|
|
services.postgresqlBackup.enable = true;
|
2022-12-10 11:16:50 +01:00
|
|
|
|
2022-12-27 20:52:04 +01:00
|
|
|
age.secrets."services/postgresql/initScript.sql" = {
|
2022-12-27 09:25:23 +01:00
|
|
|
file = ../../../secrets/services/postgresql/initScript.age;
|
|
|
|
owner = "postgres";
|
|
|
|
};
|
|
|
|
|
2022-12-10 11:16:50 +01:00
|
|
|
}
|