nixos/gitlab: fix database config when no passwordfile is defined

In commit 41ca9c1, the database config got an additional config entry
for a separate CI database connection [1]. Unfortunately, the main connection
must always be the first entry. The fix for this was only applied when
databasePasswordFile has been set.

This commit fixes the order of the config for deployments without a databasePasswordFile.

[1] https://docs.gitlab.com/ee/update/deprecations.html#single-database-connection-is-deprecated
This commit is contained in:
Tom Siewert 2024-01-10 11:36:36 +01:00 committed by Yaya
parent 6c80c4ed49
commit 890ffaa1ae

View File

@ -1359,6 +1359,7 @@ in {
''
else ''
jq <${pkgs.writeText "database.yml" (builtins.toJSON databaseConfig)} \
'${if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.9" then ".production.main as $main | del(.production.main) | .production |= {main: $main} + ." else ""}' \
>'${cfg.statePath}/config/database.yml'
''
}