nixos/gitlab: support 15.x
This commit is contained in:
parent
1e95faf0b8
commit
821724b184
1 changed files with 7 additions and 3 deletions
|
@ -17,8 +17,8 @@ let
|
||||||
gitalySocket = "${cfg.statePath}/tmp/sockets/gitaly.socket";
|
gitalySocket = "${cfg.statePath}/tmp/sockets/gitaly.socket";
|
||||||
pathUrlQuote = url: replaceStrings ["/"] ["%2F"] url;
|
pathUrlQuote = url: replaceStrings ["/"] ["%2F"] url;
|
||||||
|
|
||||||
databaseConfig = {
|
databaseConfig = let
|
||||||
production = {
|
val = {
|
||||||
adapter = "postgresql";
|
adapter = "postgresql";
|
||||||
database = cfg.databaseName;
|
database = cfg.databaseName;
|
||||||
host = cfg.databaseHost;
|
host = cfg.databaseHost;
|
||||||
|
@ -26,6 +26,10 @@ let
|
||||||
encoding = "utf8";
|
encoding = "utf8";
|
||||||
pool = cfg.databasePool;
|
pool = cfg.databasePool;
|
||||||
} // cfg.extraDatabaseConfig;
|
} // cfg.extraDatabaseConfig;
|
||||||
|
in if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.0" then {
|
||||||
|
production.main = val;
|
||||||
|
} else {
|
||||||
|
production = val;
|
||||||
};
|
};
|
||||||
|
|
||||||
# We only want to create a database if we're actually going to connect to it.
|
# We only want to create a database if we're actually going to connect to it.
|
||||||
|
@ -1184,7 +1188,7 @@ in {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jq <${pkgs.writeText "database.yml" (builtins.toJSON databaseConfig)} \
|
jq <${pkgs.writeText "database.yml" (builtins.toJSON databaseConfig)} \
|
||||||
'.production.password = $ENV.db_password' \
|
'.${if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.0" then "production.main" else "production"}.password = $ENV.db_password' \
|
||||||
>'${cfg.statePath}/config/database.yml'
|
>'${cfg.statePath}/config/database.yml'
|
||||||
''
|
''
|
||||||
else ''
|
else ''
|
||||||
|
|
Loading…
Reference in a new issue