1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-09-11 12:49:18 +03:00

postgresql: add character set config

`initdb` expects to read the locale or SQL_ASCII environment
variable to determine the most appropriate character set.
Instead, offer a configuration option.
This commit is contained in:
Kevin Griffin 2019-05-29 17:21:55 +09:00
parent 8d557721a9
commit e60725bd3d
No known key found for this signature in database
GPG Key ID: 7AABE6811CCEED54

View File

@ -61,6 +61,13 @@ in
description = ''Data directory for PostgreSQL.'';
};
characterSet = mkOption {
type = types.string;
default = "UTF8";
example = "SJIS";
description = ''Character set specified during initialization'';
};
enableTCPIP = mkOption {
type = types.bool;
default = false;
@ -101,7 +108,7 @@ in
script = ''
# Initialise the database.
if ! test -e ${cfg.dataDir}/PG_VERSION; then
initdb -U postgres -D ${cfg.dataDir}
initdb -U postgres -D ${cfg.dataDir} -E ${cfg.characterSet}
fi
${pkgs.coreutils}/bin/ln -sfn ${configFile} ${cfg.dataDir}/postgresql.conf