We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cff2756 commit 3552704Copy full SHA for 3552704
extra/services/postgres.nix
@@ -20,6 +20,17 @@ in
20
default = pkgs.postgresql;
21
defaultText = "pkgs.postgresl";
22
};
23
+
24
+ initdbArgs = mkOption {
25
+ type = with types; listOf str;
26
+ default = [ "--no-locale" ];
27
+ example = [ "--data-checksums" "--allow-group-access" ];
28
+ description = ''
29
+ Additional arguments passed to <literal>initdb</literal> during data dir
30
+ initialisation.
31
+ '';
32
+ };
33
34
35
config = {
36
packages = [ cfg.package ];
@@ -37,7 +48,7 @@ in
37
48
38
49
devshell.startup.setup-postgres.text = ''
39
50
if [[ ! -d "$PGDATA" ]]; then
40
- initdb --no-locale
51
+ initdb ${concatStringsSep " " cfg.initdbArgs}
41
52
cat >> "$PGDATA/postgresql.conf" <<EOF
42
53
listen_addresses = '''
43
54
unix_socket_directories = '$PGHOST'
0 commit comments