Commit 890ffaa1 authored by Tom Siewert's avatar Tom Siewert Committed by Yaya
Browse files

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
parent 6c80c4ed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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'
              ''
            }