depot/third_party/nixpkgs/pkgs/applications/version-management/glab/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

44 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitLab, installShellFiles, stdenv }:
buildGoModule rec {
pname = "glab";
version = "1.25.3";
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "cli";
rev = "v${version}";
hash = "sha256-x/VH6cRrJZ2t2iftBPC86FcgIwjRNzV11MwLG2y+Paw=";
};
vendorHash = "sha256-FZ1CiR8Rj/sMoCnQm6ArGQfRTlvmD14EZDmufnlTSTk=";
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
preCheck = ''
# failed to read configuration: mkdir /homeless-shelter: permission denied
export HOME=$TMPDIR
'';
subPackages = [ "cmd/glab" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
installShellCompletion --cmd glab \
--bash <($out/bin/glab completion -s bash) \
--fish <($out/bin/glab completion -s fish) \
--zsh <($out/bin/glab completion -s zsh)
'';
meta = with lib; {
description = "GitLab CLI tool bringing GitLab to your command line";
license = licenses.mit;
homepage = "https://gitlab.com/gitlab-org/cli";
maintainers = with maintainers; [ freezeboy ];
};
}