Skip to content

Commit

Permalink
fix: initdb missing data area directory
Browse files Browse the repository at this point in the history
Use `PGDATA` environment variable instead of `-D` to maintain
consistency with NixOS module.

Co-Authored-By: Michael Hoang <[email protected]>
  • Loading branch information
fesplugas and Enzime committed Nov 23, 2023
1 parent 8b6ea26 commit b2dff20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/services/postgresql/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ in
for an overview of `postgresql.conf`.
::: {.note}
String values will automatically be enclosed in single quotes. Single quotes will be
escaped with two single quotes as described by the upstream documentation linked above.
:::
'';
example = literalExpression ''
Expand Down Expand Up @@ -355,11 +355,14 @@ in
"${cfg.dataDir}/recovery.conf"
''}
exec ${postgresql}/bin/postgres -D ${cfg.dataDir}
exec ${postgresql}/bin/postgres
'';

serviceConfig.KeepAlive = true;
serviceConfig.RunAtLoad = true;
serviceConfig.EnvironmentVariables = {
PGDATA = cfg.dataDir;
};
};

};
Expand Down

0 comments on commit b2dff20

Please sign in to comment.