{ config, lib, options, pkgs, utils, ... }:
with lib;
let
cfg = config.services.gitlab;
opt = options.services.gitlab;
ruby = cfg.packages.gitlab.ruby;
postgresqlPackage = if config.services.postgresql.enable then
config.services.postgresql.package
else
pkgs.postgresql_12;
gitlabSocket = "${cfg.statePath}/tmp/sockets/gitlab.socket";
gitalySocket = "${cfg.statePath}/tmp/sockets/gitaly.socket";
pathUrlQuote = url: replaceStrings ["/"] ["%2F"] url;
databaseConfig = {
production = {
adapter = "postgresql";
database = cfg.databaseName;
host = cfg.databaseHost;
username = cfg.databaseUsername;
encoding = "utf8";
pool = cfg.databasePool;
} // cfg