diff options
| author | Francesc Esplugas <2720+fesplugas@users.noreply.github.com> | 2023-10-16 23:31:15 +0200 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2023-11-23 11:00:33 +1100 |
| commit | b2dff2033d72b7e9ed9a3a135327fead70c61b08 (patch) | |
| tree | 57ec963f71b77a24aba11bddb361b41a86bdd37a | |
| parent | 8b6ea26d5d2e8359d06278364f41fbc4b903b28a (diff) | |
fix: initdb missing data area directory
Use `PGDATA` environment variable instead of `-D` to maintain
consistency with NixOS module.
Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
| -rw-r--r-- | modules/services/postgresql/default.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/services/postgresql/default.nix b/modules/services/postgresql/default.nix index 018b46e..64a2ece 100644 --- a/modules/services/postgresql/default.nix +++ b/modules/services/postgresql/default.nix @@ -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 '' @@ -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; + }; }; }; |
