anchor.diff:       '';
     };
   
  +  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
  
positive.code:         type = types.attrs;
          default = {};
          description = "Extra configuration in config/database.yml.";
        };
  
        host = mkOption {
  
negative.code:         [ -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
          ''}
  