about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2015-01-25 16:01:48 -0500
committerCharles Strahan <charles.c.strahan@gmail.com>2015-01-25 16:28:18 -0500
commit6eaa4199202c905776a8227f1b6a8056ed2686fd (patch)
tree52b153347deb43440e135536c0217c5fce59b42e /nixos
parent989a894fc8943271f70d208b584394f54d157eaf (diff)
downloadnixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.tar
nixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.tar.gz
nixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.tar.bz2
nixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.tar.lz
nixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.tar.xz
nixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.tar.zst
nixlib-6eaa4199202c905776a8227f1b6a8056ed2686fd.zip
gitlab: fix evaluation
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/gitlab.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix
index efa139c8dfd2..78497babb342 100644
--- a/nixos/modules/services/misc/gitlab.nix
+++ b/nixos/modules/services/misc/gitlab.nix
@@ -7,8 +7,10 @@ with lib;
 let
   cfg = config.services.gitlab;
 
-  ruby = pkgs.ruby;
-  rubyLibs = pkgs.rubyLibs;
+  ruby = pkgs.gitlab.ruby;
+  bundler = pkgs.bundler;
+
+  gemHome = "${pkgs.gitlab.env}/${ruby.gemPath}"
 
   databaseYml = ''
     production:
@@ -38,13 +40,14 @@ let
 
   gitlab-runner = pkgs.stdenv.mkDerivation rec {
     name = "gitlab-runner";
-    buildInputs = [ pkgs.gitlab pkgs.rubyLibs.bundler pkgs.makeWrapper ];
+    buildInputs = [ pkgs.gitlab pkgs.bundler pkgs.makeWrapper ];
     phases = "installPhase fixupPhase";
     buildPhase = "";
     installPhase = ''
       mkdir -p $out/bin
-      makeWrapper ${rubyLibs.bundler}/bin/bundle $out/bin/gitlab-runner\
+      makeWrapper ${bundler}/bin/bundle $out/bin/gitlab-runner\
           --set RAKEOPT '"-f ${pkgs.gitlab}/share/gitlab/Rakefile"'\
+          --set GEM_HOME '${gemHome}'\
           --set UNICORN_PATH "${cfg.stateDir}/"\
           --set GITLAB_PATH "${pkgs.gitlab}/share/gitlab/"\
           --set GITLAB_APPLICATION_LOG_PATH "${cfg.stateDir}/log/application.log"\
@@ -172,6 +175,7 @@ in {
       after = [ "network.target" "redis.service" ];
       wantedBy = [ "multi-user.target" ];
       environment.HOME = "${cfg.stateDir}/home";
+      environment.GEM_HOME = gemHome;
       environment.UNICORN_PATH = "${cfg.stateDir}/";
       environment.GITLAB_PATH = "${pkgs.gitlab}/share/gitlab/";
       environment.GITLAB_APPLICATION_LOG_PATH = "${cfg.stateDir}/log/application.log";
@@ -201,7 +205,7 @@ in {
         Group = "gitlab";
         TimeoutSec = "300";
         WorkingDirectory = "${pkgs.gitlab}/share/gitlab";
-        ExecStart="${rubyLibs.bundler}/bin/bundle exec \"sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e production -P ${cfg.stateDir}/tmp/sidekiq.pid\"";
+        ExecStart="${bundler}/bin/bundle exec \"sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e production -P ${cfg.stateDir}/tmp/sidekiq.pid\"";
       };
     };
 
@@ -209,6 +213,7 @@ in {
       after = [ "network.target" "postgresql.service" "redis.service" ];
       wantedBy = [ "multi-user.target" ];
       environment.HOME = "${cfg.stateDir}/home";
+      environment.GEM_HOME = gemHome;
       environment.UNICORN_PATH = "${cfg.stateDir}/";
       environment.GITLAB_PATH = "${pkgs.gitlab}/share/gitlab/";
       environment.GITLAB_APPLICATION_LOG_PATH = "${cfg.stateDir}/log/application.log";
@@ -263,7 +268,7 @@ in {
 
             # force=yes disables the manual-interaction yes/no prompt
             # which breaks without an stdin.
-            force=yes ${rubyLibs.bundler}/bin/bundle exec rake -f ${pkgs.gitlab}/share/gitlab/Rakefile gitlab:setup RAILS_ENV=production
+            force=yes ${bundler}/bin/bundle exec rake -f ${pkgs.gitlab}/share/gitlab/Rakefile gitlab:setup RAILS_ENV=production
           fi
         fi
 
@@ -285,7 +290,7 @@ in {
         Group = "gitlab";
         TimeoutSec = "300";
         WorkingDirectory = "${pkgs.gitlab}/share/gitlab";
-        ExecStart="${rubyLibs.bundler}/bin/bundle exec \"unicorn -c ${cfg.stateDir}/config/unicorn.rb -E production\"";
+        ExecStart="${bundler}/bin/bundle exec \"unicorn -c ${cfg.stateDir}/config/unicorn.rb -E production\"";
       };
 
     };