about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-03-26 11:08:11 +0100
committerGitHub <noreply@github.com>2019-03-26 11:08:11 +0100
commit476760bfeb4d54e4fee3fa239cfb018aa456d156 (patch)
treecdbfdb7c48ebe6b570d6f40c6dd1bb7ac2aa74ae /nixos
parentc717fe09aa2abcf4ee7aaebd7554ea9d4a3dbde6 (diff)
parentf2bdc91b3563e50f714c3fbdd82e3377b39b5348 (diff)
downloadnixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.tar
nixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.tar.gz
nixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.tar.bz2
nixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.tar.lz
nixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.tar.xz
nixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.tar.zst
nixlib-476760bfeb4d54e4fee3fa239cfb018aa456d156.zip
Merge pull request #57578 from bgamari/gitlab-extra-initializers
nixos/gitlab: Allow configuration of extra initializers
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/gitlab.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix
index baa1c855c116..17c8c3ce51f4 100644
--- a/nixos/modules/services/misc/gitlab.nix
+++ b/nixos/modules/services/misc/gitlab.nix
@@ -160,6 +160,8 @@ let
      '';
   };
 
+  extraGitlabRb = pkgs.writeText "extra-gitlab.rb" cfg.extraGitlabRb;
+
   smtpSettings = pkgs.writeText "gitlab-smtp-settings.rb" ''
     if Rails.env.production?
       Rails.application.config.action_mailer.delivery_method = :smtp
@@ -266,6 +268,26 @@ in {
         description = "Extra configuration in config/database.yml.";
       };
 
+      extraGitlabRb = mkOption {
+        type = types.str;
+        default = "";
+        example = ''
+          if Rails.env.production?
+            Rails.application.config.action_mailer.delivery_method = :sendmail
+            ActionMailer::Base.delivery_method = :sendmail
+            ActionMailer::Base.sendmail_settings = {
+              location: "/run/wrappers/bin/sendmail",
+              arguments: "-i -t"
+            }
+          end
+        '';
+        description = ''
+          Extra configuration to be placed in config/extra-gitlab.rb. This can
+          be used to add configuration not otherwise exposed through this module's
+          options.
+        '';
+      };
+
       host = mkOption {
         type = types.str;
         default = config.networking.hostName;
@@ -586,6 +608,7 @@ in {
         [ -L /run/gitlab/uploads ] || ln -sf ${cfg.statePath}/uploads /run/gitlab/uploads
         cp ${cfg.packages.gitlab}/share/gitlab/VERSION ${cfg.statePath}/VERSION
         cp -rf ${cfg.packages.gitlab}/share/gitlab/config.dist/* ${cfg.statePath}/config
+        ln -sf ${extraGitlabRb} ${cfg.statePath}/config/initializers/extra-gitlab.rb
         ${optionalString cfg.smtp.enable ''
           ln -sf ${smtpSettings} ${cfg.statePath}/config/initializers/smtp_settings.rb
         ''}