nixpkgs/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix
Wael M. Nasreddine 483d823ec4
gitlab-shell: export GOCACHE in the installPhase
TMPDIR, in `GOCACHE = "$TMPDIR";`, will not be intepreted  when it's set
outside of a phase.
2019-03-11 09:59:15 -07:00

48 lines
1.3 KiB
Nix

{ stdenv, ruby, bundler, fetchFromGitLab, go }:
stdenv.mkDerivation rec {
version = "8.4.4";
name = "gitlab-shell-${version}";
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "gitlab-shell";
rev = "v${version}";
sha256 = "1a6p13g38f4gqqfjgymcvf09k4mnr2bfpj8mqz0x6rz7q67lllcq";
};
buildInputs = [ ruby bundler go ];
patches = [ ./remove-hardcoded-locations.patch ];
installPhase = ''
export GOCACHE="$TMPDIR/go-cache"
ruby bin/compile
mkdir -p $out/
cp -R . $out/
# Nothing to install ATM for non-development but keeping the
# install command anyway in case that changes in the future:
export HOME=$(pwd)
bundle install -j4 --verbose --local --deployment --without development test
'';
# gitlab-shell will try to read its config relative to the source
# code by default which doesn't work in nixos because it's a
# read-only filesystem
postPatch = ''
substituteInPlace lib/gitlab_config.rb --replace \
"File.join(ROOT_PATH, 'config.yml')" \
"'/run/gitlab/shell-config.yml'"
'';
meta = with stdenv.lib; {
description = "SSH access and repository management app for GitLab";
homepage = http://www.gitlab.com/;
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz globin ];
license = licenses.mit;
};
}