summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/services/postgresql/default.nix9
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