2024-08-24 13:01:59 +00:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# backup postgresql databases (everything in ensuredatabases)
|
|
|
|
services.postgresqlBackup = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
compression = "zstd";
|
|
|
|
|
2024-12-30 21:53:38 +00:00
|
|
|
# default to backup all databases
|
2024-08-24 13:01:59 +00:00
|
|
|
databases = config.services.postgresql.ensureDatabases;
|
|
|
|
};
|
|
|
|
|
|
|
|
# default the locale to C. I have NO CLUE why you would
|
|
|
|
# like to use any other locale, than the default C.
|
|
|
|
# However, matrix synapse complains A LOT if it isn't C,
|
|
|
|
# so we just default to it! No worries!
|
|
|
|
# Matrix Synapse Locale Note
|
|
|
|
# - https://github.com/element-hq/synapse/blob/develop/docs/postgres.md#fixing-incorrect-collate-or-ctype
|
|
|
|
# NOTE from postgresql here https://www.postgresql.org/docs/current/locale.html
|
|
|
|
# Using C.UTF-8, because setting `LC_CTYPE=C` will default encoding to SQL_ASCII.
|
|
|
|
# https://pganalyze.com/blog/5mins-postgres-17-builtin-c-utf8-locale
|
|
|
|
systemd.services.postgresql.environment = {
|
|
|
|
LC_CTYPE = "C.UTF-8";
|
|
|
|
LC_COLLATE = "C";
|
|
|
|
};
|
|
|
|
}
|