2022-12-02 08:20:57 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitLab, installShellFiles, stdenv }:
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "glab";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.29.4";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "cli";
|
2020-11-30 08:33:03 +00:00
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-ZmmsZ0+KuuLRgnFXGO0V+8Hm24THyHEZq/a+araTR9I=";
|
2020-11-30 08:33:03 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
vendorHash = "sha256-WfzN70HHLatBuV+GW2VC+5laR3rBfDOqPydyxMSmL3s=";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
2021-08-11 14:56:57 +00:00
|
|
|
ldflags = [
|
2022-12-02 08:20:57 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2021-08-11 14:56:57 +00:00
|
|
|
"-X main.version=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# failed to read configuration: mkdir /homeless-shelter: permission denied
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/glab" ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
meta = with lib; {
|
2022-12-02 08:20:57 +00:00
|
|
|
description = "GitLab CLI tool bringing GitLab to your command line";
|
2020-11-30 08:33:03 +00:00
|
|
|
license = licenses.mit;
|
2022-12-02 08:20:57 +00:00
|
|
|
homepage = "https://gitlab.com/gitlab-org/cli";
|
2020-11-30 08:33:03 +00:00
|
|
|
maintainers = with maintainers; [ freezeboy ];
|
|
|
|
};
|
|
|
|
}
|