nixpkgs/pkgs/applications/version-management/glab/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitLab, installShellFiles, stdenv }:
2020-11-26 15:27:31 +00:00
buildGoModule rec {
pname = "glab";
2024-03-08 00:16:08 +00:00
version = "1.37.0";
2020-11-26 15:27:31 +00:00
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "cli";
2020-11-26 15:27:31 +00:00
rev = "v${version}";
2024-03-08 00:16:08 +00:00
hash = "sha256-H1yYjI7ct/YO44czX5J0cHc/YbhxtXJQThJcARyUEq0=";
2020-11-26 15:27:31 +00:00
};
2024-03-08 00:16:08 +00:00
vendorHash = "sha256-4CQ4NPHAs736LQxDxvKWEH9TQvIKAouJ6zVReAoZTec=";
2020-11-26 15:27:31 +00:00
2021-08-11 11:40:24 +00:00
ldflags = [
"-s"
"-w"
2021-08-11 11:40:24 +00:00
"-X main.version=${version}"
];
preCheck = ''
# failed to read configuration: mkdir /homeless-shelter: permission denied
export HOME=$TMPDIR
'';
2020-11-26 15:27:31 +00:00
subPackages = [ "cmd/glab" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
2023-09-13 04:20:00 +00:00
make manpage
installManPage share/man/man1/*
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-26 15:27:31 +00:00
meta = with lib; {
description = "GitLab CLI tool bringing GitLab to your command line";
2020-11-26 15:27:31 +00:00
license = licenses.mit;
homepage = "https://gitlab.com/gitlab-org/cli";
2023-09-13 04:20:00 +00:00
changelog = "https://gitlab.com/gitlab-org/cli/-/releases/v${version}";
2020-11-26 15:27:31 +00:00
maintainers = with maintainers; [ freezeboy ];
2023-11-27 01:17:53 +00:00
mainProgram = "glab";
2020-11-26 15:27:31 +00:00
};
}