git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #57578 from bgamari/gitlab-extra-initializers

nixos/gitlab: Allow configuration of extra initializers

commit476760bfeb4d54e4fee3fa239cfb018aa456d156 authorFlorian Klink <flokli@flokli.de> dateTue 26 Mar 2019, 11:08 (8 years ago) parentc717fe0f2bdc91
1 file changed+23
nixos/modules/services/misc/gitlab.nix+23
nixos/modules/services/misc/gitlab.nix+23
@@ -160,6 +160,8 @@ let
160160 '';
161161 };
162162
163+ extraGitlabRb = pkgs.writeText "extra-gitlab.rb" cfg.extraGitlabRb;
164+
163165 smtpSettings = pkgs.writeText "gitlab-smtp-settings.rb" ''
164166 if Rails.env.production?
165167 Rails.application.config.action_mailer.delivery_method = :smtp
@@ -266,6 +268,26 @@ in {
266268 description = "Extra configuration in config/database.yml.";
267269 };
268270
271+ extraGitlabRb = mkOption {
272+ type = types.str;
273+ default = "";
274+ example = ''
275+ if Rails.env.production?
276+ Rails.application.config.action_mailer.delivery_method = :sendmail
277+ ActionMailer::Base.delivery_method = :sendmail
278+ ActionMailer::Base.sendmail_settings = {
279+ location: "/run/wrappers/bin/sendmail",
280+ arguments: "-i -t"
281+ }
282+ end
283+ '';
284+ description = ''
285+ Extra configuration to be placed in config/extra-gitlab.rb. This can
286+ be used to add configuration not otherwise exposed through this module's
287+ options.
288+ '';
289+ };
290+
269291 host = mkOption {
270292 type = types.str;
271293 default = config.networking.hostName;
@@ -586,6 +608,7 @@ in {
586608 [ -L /run/gitlab/uploads ] || ln -sf ${cfg.statePath}/uploads /run/gitlab/uploads
587609 cp ${cfg.packages.gitlab}/share/gitlab/VERSION ${cfg.statePath}/VERSION
588610 cp -rf ${cfg.packages.gitlab}/share/gitlab/config.dist/* ${cfg.statePath}/config
611+ ln -sf ${extraGitlabRb} ${cfg.statePath}/config/initializers/extra-gitlab.rb
589612 ${optionalString cfg.smtp.enable ''
590613 ln -sf ${smtpSettings} ${cfg.statePath}/config/initializers/smtp_settings.rb
591614 ''}