about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorTom Siewert <tom@siewert.io>2024-01-10 11:36:36 +0100
committerYaya <github@uwu.is>2024-01-10 14:35:57 +0100
commit890ffaa1aed7e5a36dd19ba1a047daa4d66f410b (patch)
treea47723e00a70c0e1fa5e7a5ad082e3f2cd9f29f0 /nixos
parent6c80c4ed499c0bd213f5f8bd0a6b3958bc9abbe2 (diff)
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
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/gitlab.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix
index ca6910b795d8f..d8e4aab4feea5 100644
--- a/nixos/modules/services/misc/gitlab.nix
+++ b/nixos/modules/services/misc/gitlab.nix
@@ -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'
               ''
             }