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.

45 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitLab, installShellFiles, stdenv }:
2020-11-26 15:27:31 +00:00
buildGoModule rec {
pname = "glab";
2023-03-11 07:42:10 +00:00
version = "1.26.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-03-11 07:42:10 +00:00
hash = "sha256-k0wkHw12MyVsAudaihoymGkP4y5y98cR7LKa+hEC1Mc=";
2020-11-26 15:27:31 +00:00
};
2023-02-08 05:32:31 +00:00
vendorHash = "sha256-FZ1CiR8Rj/sMoCnQm6ArGQfRTlvmD14EZDmufnlTSTk=";
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) ''
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";
2020-11-26 15:27:31 +00:00
maintainers = with maintainers; [ freezeboy ];
};
}