at 18.03-beta 64 lines 2.2 kB view raw
1{ stdenv, ruby, bundler, fetchFromGitLab, go }: 2 3stdenv.mkDerivation rec { 4 version = "5.10.2"; 5 name = "gitlab-shell-${version}"; 6 7 srcs = fetchFromGitLab { 8 owner = "gitlab-org"; 9 repo = "gitlab-shell"; 10 rev = "v${version}"; 11 sha256 = "16lwnzsppql7pkf8fka6cwkghdr57g225zvln9ii29w7nzz1hvaf"; 12 }; 13 14 buildInputs = [ ruby bundler go ]; 15 16 patches = [ ./remove-hardcoded-locations.patch ./fixes.patch ]; 17 18 installPhase = '' 19 ruby bin/compile 20 mkdir -p $out/ 21 cp -R . $out/ 22 23 # Nothing to install ATM for non-development but keeping the 24 # install command anyway in case that changes in the future: 25 export HOME=$(pwd) 26 bundle install -j4 --verbose --local --deployment --without development test 27 ''; 28 29 # gitlab-shell will try to read its config relative to the source 30 # code by default which doesn't work in nixos because it's a 31 # read-only filesystem 32 postPatch = '' 33 substituteInPlace lib/gitlab_config.rb --replace\ 34 "File.join(ROOT_PATH, 'config.yml')"\ 35 "ENV['GITLAB_SHELL_CONFIG_PATH']" 36 37 # Note that we're running gitlab-shell from current-system/sw 38 # because otherwise updating gitlab-shell won't be reflected in 39 # the hardcoded path of the authorized-keys file: 40 substituteInPlace lib/gitlab_keys.rb --replace\ 41 "\"#{ROOT_PATH}/bin/gitlab-shell"\ 42 "\"GITLAB_SHELL_CONFIG_PATH=#{ENV['GITLAB_SHELL_CONFIG_PATH']} /run/current-system/sw/bin/gitlab-shell" 43 44 # We're setting GITLAB_SHELL_CONFIG_PATH in the ssh authorized key 45 # environment because we need it in gitlab_configrb 46 # . unsetenv_others will remove that so we're not doing it for 47 # now. 48 # 49 # TODO: Are there any security implications? The commit adding 50 # unsetenv_others didn't mention anything... 51 # 52 # Kernel::exec({'PATH' => ENV['PATH'], 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], 'GL_ID' => ENV['GL_ID']}, *args, unsetenv_others: true) 53 substituteInPlace lib/gitlab_shell.rb --replace\ 54 " *args, unsetenv_others: true)"\ 55 " *args)" 56 ''; 57 58 meta = with stdenv.lib; { 59 homepage = http://www.gitlab.com/; 60 platforms = platforms.unix; 61 maintainers = with maintainers; [ fpletz ]; 62 license = licenses.mit; 63 }; 64}