2019-10-01 14:38:22 +01:00
|
|
|
{ stdenv, ruby, bundler, fetchFromGitLab, buildGoPackage, bundlerEnv }:
|
2015-01-25 21:10:04 +00:00
|
|
|
|
2019-10-01 14:38:22 +01:00
|
|
|
let
|
|
|
|
version = "10.0.0";
|
2018-09-21 08:34:26 +01:00
|
|
|
src = fetchFromGitLab {
|
2016-01-30 13:47:04 +00:00
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitlab-shell";
|
|
|
|
rev = "v${version}";
|
2019-10-01 14:38:22 +01:00
|
|
|
sha256 = "0n1llkb0jrqxm10l9wqmqxjycydqphgz0chbbf395d8pywyz826x";
|
2014-10-25 17:22:49 +01:00
|
|
|
};
|
2019-10-01 14:38:22 +01:00
|
|
|
rubyEnv = bundlerEnv {
|
|
|
|
name = "gitlab-shell-env";
|
|
|
|
inherit ruby;
|
|
|
|
gemdir = ./.;
|
|
|
|
};
|
|
|
|
goPackage = buildGoPackage {
|
|
|
|
pname = "gitlab-shell-go";
|
|
|
|
inherit src version;
|
2014-10-25 17:22:49 +01:00
|
|
|
|
2019-10-02 15:44:55 +01:00
|
|
|
patches = [ ./remove-hardcoded-locations-go.patch ];
|
2016-01-30 13:47:04 +00:00
|
|
|
|
2019-10-01 14:38:22 +01:00
|
|
|
goPackagePath = "gitlab.com/gitlab-org/gitlab-shell";
|
|
|
|
goDeps = ./deps.nix;
|
2019-03-10 20:56:12 +00:00
|
|
|
|
2019-10-01 14:38:22 +01:00
|
|
|
# gitlab-shell depends on an older version of gitaly which
|
|
|
|
# contains old, vendored versions of some packages; gitlab-shell
|
|
|
|
# also explicitly depends on newer versions of these libraries,
|
|
|
|
# but buildGoPackage exposes the vendored versions instead,
|
|
|
|
# leading to compilation errors. Since the vendored libraries
|
|
|
|
# aren't used here anyway, we'll just remove them.
|
|
|
|
postConfigure = ''
|
|
|
|
rm -r "$NIX_BUILD_TOP/go/src/gitlab.com/gitlab-org/gitaly/vendor/"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "gitlab-shell";
|
|
|
|
inherit src version;
|
2019-10-02 15:44:55 +01:00
|
|
|
|
|
|
|
patches = [ ./remove-hardcoded-locations-ruby.patch ];
|
2015-01-25 21:10:04 +00:00
|
|
|
|
2014-10-25 17:22:49 +01:00
|
|
|
# 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 = ''
|
2018-03-19 20:52:36 +00:00
|
|
|
substituteInPlace lib/gitlab_config.rb --replace \
|
2019-10-01 14:38:22 +01:00
|
|
|
"File.join(ROOT_PATH, 'config.yml')" \
|
|
|
|
"'/run/gitlab/shell-config.yml'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ rubyEnv.wrappedRuby ];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/
|
|
|
|
cp -R . $out/
|
|
|
|
cp ${goPackage.bin}/bin/* $out/bin/
|
|
|
|
|
|
|
|
runHook postInstall
|
2014-10-25 17:22:49 +01:00
|
|
|
'';
|
|
|
|
|
2016-09-27 14:49:21 +01:00
|
|
|
meta = with stdenv.lib; {
|
2018-09-21 08:34:26 +01:00
|
|
|
description = "SSH access and repository management app for GitLab";
|
2016-09-27 14:49:21 +01:00
|
|
|
homepage = http://www.gitlab.com/;
|
|
|
|
platforms = platforms.unix;
|
2018-04-25 18:55:58 +01:00
|
|
|
maintainers = with maintainers; [ fpletz globin ];
|
2016-09-27 14:49:21 +01:00
|
|
|
license = licenses.mit;
|
2016-08-02 17:06:29 +01:00
|
|
|
};
|
2014-10-25 17:22:49 +01:00
|
|
|
}
|