1{ stdenv, ruby, bundler, fetchFromGitLab, go }:
2
3stdenv.mkDerivation rec {
4 version = "9.3.0";
5 name = "gitlab-shell-${version}";
6
7 src = fetchFromGitLab {
8 owner = "gitlab-org";
9 repo = "gitlab-shell";
10 rev = "v${version}";
11 sha256 = "1r000h4sgplx7giqvqs5iy0zh3drf6qa1iiq0mxlk3h9fshs1348";
12 };
13
14 buildInputs = [ ruby bundler go ];
15
16 patches = [ ./remove-hardcoded-locations.patch ];
17
18 installPhase = ''
19 export GOCACHE="$TMPDIR/go-cache"
20
21 ruby bin/compile
22 mkdir -p $out/
23 cp -R . $out/
24
25 # Nothing to install ATM for non-development but keeping the
26 # install command anyway in case that changes in the future:
27 export HOME=$(pwd)
28 bundle install -j4 --verbose --local --deployment --without development test
29 '';
30
31 # gitlab-shell will try to read its config relative to the source
32 # code by default which doesn't work in nixos because it's a
33 # read-only filesystem
34 postPatch = ''
35 substituteInPlace lib/gitlab_config.rb --replace \
36 "File.join(ROOT_PATH, 'config.yml')" \
37 "'/run/gitlab/shell-config.yml'"
38 '';
39
40 meta = with stdenv.lib; {
41 description = "SSH access and repository management app for GitLab";
42 homepage = http://www.gitlab.com/;
43 platforms = platforms.unix;
44 maintainers = with maintainers; [ fpletz globin ];
45 license = licenses.mit;
46 };
47}