Merge: nixos/postgresql: fix condition for readwritepaths (#372164)

This commit is contained in:
Maximilian Bosch 2025-01-19 12:32:13 +01:00 committed by GitHub
commit c1bf44ab55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -733,10 +733,12 @@ in
] ++ lib.optionals (any extensionInstalled [ "plv8" ]) [ "@pkey" ];
UMask = if groupAccessAvailable then "0027" else "0077";
}
(mkIf (cfg.dataDir != "/var/lib/postgresql") {
(mkIf (cfg.dataDir != "/var/lib/postgresql/${cfg.package.psqlSchema}") {
# The user provides their own data directory
ReadWritePaths = [ cfg.dataDir ];
})
(mkIf (cfg.dataDir == "/var/lib/postgresql/${cfg.package.psqlSchema}") {
# Provision the default data directory
StateDirectory = "postgresql postgresql/${cfg.package.psqlSchema}";
StateDirectoryMode = if groupAccessAvailable then "0750" else "0700";
})