diff options
| author | Kevin Griffin <kev@bibo.com.ph> | 2019-05-29 17:21:55 +0900 |
|---|---|---|
| committer | Kevin Griffin <kev@bibo.com.ph> | 2019-05-29 17:25:56 +0900 |
| commit | e60725bd3df70da3ce294dc197ad461825ee8c62 (patch) | |
| tree | 89b2f674c6885d449451a83beb226cf08c84721b /modules/services/postgresql | |
| parent | 8d557721a9511d8e6b26c140363ab44d2c98f76b (diff) | |
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.
Diffstat (limited to 'modules/services/postgresql')
| -rw-r--r-- | modules/services/postgresql/default.nix | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/services/postgresql/default.nix b/modules/services/postgresql/default.nix index 5b29b68..35a4aed 100644 --- a/modules/services/postgresql/default.nix +++ b/modules/services/postgresql/default.nix @@ -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 |
