nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 makeBinaryWrapper,
6 xdg-utils,
7 installShellFiles,
8 git,
9}:
10
11buildGoModule rec {
12 pname = "lab";
13 version = "0.25.1";
14
15 src = fetchFromGitHub {
16 owner = "zaquestion";
17 repo = "lab";
18 rev = "v${version}";
19 sha256 = "sha256-VCvjP/bSd/0ywvNWPsseXn/SPkdp+BsXc/jTvB11EOk=";
20 };
21
22 subPackages = [ "." ];
23
24 vendorHash = "sha256-ChysquNuUffcM3qaWUdqu3Av33gnKkdlotEoFKoedA0=";
25
26 doCheck = false;
27
28 nativeBuildInputs = [
29 makeBinaryWrapper
30 installShellFiles
31 ];
32
33 ldflags = [
34 "-s"
35 "-w"
36 "-X main.version=${version}"
37 ];
38
39 postInstall = ''
40 # create shell completions before wrapProgram so that lab detects the right path for itself
41 installShellCompletion --cmd lab \
42 --bash <($out/bin/lab completion bash) \
43 --fish <($out/bin/lab completion fish) \
44 --zsh <($out/bin/lab completion zsh)
45 # make xdg-open overrideable at runtime
46 wrapProgram $out/bin/lab \
47 --suffix PATH ":" "${
48 lib.makeBinPath [
49 git
50 xdg-utils
51 ]
52 }"
53 '';
54
55 meta = {
56 description = "Wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab";
57 homepage = "https://zaquestion.github.io/lab";
58 license = lib.licenses.cc0;
59 maintainers = [ ];
60 mainProgram = "lab";
61 };
62}