You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.nix 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. { stdenv, fetchFromGitLab, buildGoPackage, ruby, bundlerEnv, pkgconfig, libgit2 }:
  2. let
  3. rubyEnv = bundlerEnv rec {
  4. name = "gitaly-env";
  5. inherit ruby;
  6. gemdir = ./.;
  7. gemset =
  8. let x = import (gemdir + "/gemset.nix");
  9. in x // {
  10. # grpc expects the AR environment variable to contain `ar rpc`. See the
  11. # discussion in nixpkgs #63056.
  12. grpc = x.grpc // {
  13. patches = [ ../fix-grpc-ar.patch ];
  14. dontBuild = false;
  15. };
  16. };
  17. };
  18. in buildGoPackage rec {
  19. version = "1.53.2";
  20. pname = "gitaly";
  21. src = fetchFromGitLab {
  22. owner = "gitlab-org";
  23. repo = "gitaly";
  24. rev = "v${version}";
  25. sha256 = "0x4dhqaxx6n5jlcvf69rglxiz11037ghgcnskks6qnlcbkd85j3d";
  26. };
  27. goPackagePath = "gitlab.com/gitlab-org/gitaly";
  28. passthru = {
  29. inherit rubyEnv;
  30. };
  31. nativeBuildInputs = [ pkgconfig ];
  32. buildInputs = [ rubyEnv.wrappedRuby libgit2 ];
  33. goDeps = ./deps.nix;
  34. preBuild = "rm -r go/src/gitlab.com/gitlab-org/labkit/vendor";
  35. postInstall = ''
  36. mkdir -p $ruby
  37. cp -rv $src/ruby/{bin,lib,git-hooks,gitlab-shell} $ruby
  38. # gitlab-shell will try to read its config relative to the source
  39. # code by default which doesn't work in nixos because it's a
  40. # read-only filesystem
  41. substituteInPlace $ruby/gitlab-shell/lib/gitlab_config.rb --replace \
  42. "File.join(ROOT_PATH, 'config.yml')" \
  43. "'/run/gitlab/shell-config.yml'"
  44. '';
  45. outputs = [ "bin" "out" "ruby" ];
  46. meta = with stdenv.lib; {
  47. homepage = https://gitlab.com/gitlab-org/gitaly;
  48. description = "A Git RPC service for handling all the git calls made by GitLab";
  49. platforms = platforms.unix;
  50. maintainers = with maintainers; [ roblabla globin fpletz ];
  51. license = licenses.mit;
  52. };
  53. }