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";
2023-11-07 14:56:57 +00:00
version = "1.35.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}";
2023-11-07 14:56:57 +00:00
hash = "sha256-4kd3+IdVZbWVGbY3B8V1F07k67BvKOCfom4ZukNxrRo=";
2020-11-26 15:27:31 +00:00
};
2023-11-07 14:56:57 +00:00
vendorHash = "sha256-x96ChhozvTrX0eBWt3peX8dpd4gyukJ28RkqcD2W/OM=";
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
};
}