Skip to content

Commit

Permalink
nixos/gitlab: Package gitlab-rails
Browse files Browse the repository at this point in the history
This utility (particularly `gitlab-rails console`) is packaged by GitLab
Omnibus and is used for diagnostics and maintenance operations.
  • Loading branch information
bgamari committed Mar 28, 2019
1 parent d984875 commit af909b3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion nixos/modules/services/misc/gitlab.nix
Expand Up @@ -160,6 +160,20 @@ let
'';
};

gitlab-rails = pkgs.stdenv.mkDerivation rec {
name = "gitlab-rails";
buildInputs = [ pkgs.makeWrapper ];
dontBuild = true;
unpackPhase = ":";
installPhase = ''
mkdir -p $out/bin
makeWrapper ${cfg.packages.gitlab.rubyEnv}/bin/rails $out/bin/gitlab-rails \
${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \
--set PATH '${lib.makeBinPath [ pkgs.nodejs pkgs.gzip pkgs.git pkgs.gnutar config.services.postgresql.package pkgs.coreutils pkgs.procps ]}:$PATH' \
--run 'cd ${cfg.packages.gitlab}/share/gitlab'
'';
};

extraGitlabRb = pkgs.writeText "extra-gitlab.rb" cfg.extraGitlabRb;

smtpSettings = pkgs.writeText "gitlab-smtp-settings.rb" ''
Expand Down Expand Up @@ -461,7 +475,7 @@ in {

config = mkIf cfg.enable {

environment.systemPackages = [ pkgs.git gitlab-rake cfg.packages.gitlab-shell ];
environment.systemPackages = [ pkgs.git gitlab-rake gitlab-rails cfg.packages.gitlab-shell ];

# Redis is required for the sidekiq queue runner.
services.redis.enable = mkDefault true;
Expand Down

0 comments on commit af909b3

Please sign in to comment.