summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/ghq/default.nix
blob: 84a441641dfa0031e18ff69771119082fbe21182 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  name = "ghq-${version}";
  version = "0.8.0";

  goPackagePath = "github.com/motemen/ghq";

  src = fetchFromGitHub {
    owner = "motemen";
    repo = "ghq";
    rev = "v${version}";
    sha256 = "1gdi0sbmq9kfi8hzd0dpgmhbmcf8q93jy3x08dd8smayrhbbwmld";
  };

  goDeps = ./deps.nix;

  buildFlagsArray = ''
    -ldflags=
      -X=main.Version=${version}
  '';

  postInstall = ''
    install -m 444 -D ${src}/zsh/_ghq $bin/share/zsh/site-functions/_ghq
  '';

  meta = {
    description = "Remote repository management made easy";
    homepage = https://github.com/motemen/ghq;
    maintainers = with stdenv.lib.maintainers; [ sigma ];
    license = stdenv.lib.licenses.mit;
  };
}