mediawiki: fix postgres external database host address

Fixes https://github.com/NixOS/nixpkgs/issues/448766
This commit is contained in:
Antonin Loubiere
2026-08-18 12:47:01 +02:00
committed by GitHub
parent 8324c08c41
commit b93a0c3c7d

View File

@@ -109,12 +109,12 @@ let
'';
dbAddr =
if cfg.database.socket == null then
if cfg.database.type == "postgres" then
(if cfg.database.socket == null then cfg.database.host else cfg.database.socket)
else if cfg.database.socket == null then
"${cfg.database.host}:${toString cfg.database.port}"
else if cfg.database.type == "mysql" then
"${cfg.database.host}:${cfg.database.socket}"
else if cfg.database.type == "postgres" then
"${cfg.database.socket}"
else
throw "Unsupported database type: ${cfg.database.type} for socket: ${cfg.database.socket}";