gerd.postgresql: initial add
This commit is contained in:
parent
b9163999bb
commit
84a3027d0c
3 changed files with 55 additions and 0 deletions
31
shared/applications/server/postgresql.nix
Normal file
31
shared/applications/server/postgresql.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# backup postgresql databases (everything in ensuredatabases)
|
||||
services.postgresqlBackup = {
|
||||
enable = true;
|
||||
|
||||
compression = "zstd";
|
||||
|
||||
# default to backup all databadatabases
|
||||
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";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue