Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
93 lines
2.1 KiB
Nix
93 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitLab,
|
|
installShellFiles,
|
|
makeBinaryWrapper,
|
|
stdenv,
|
|
nix-update-script,
|
|
writableTmpDirAsHomeHook,
|
|
versionCheckHook,
|
|
gitMinimal,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "glab";
|
|
version = "1.73.0";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "gitlab-org";
|
|
repo = "cli";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-2beWB7QD2oeGZIjDWxKyqZLGzNJKWlRuqA1h7GRu1G4=";
|
|
leaveDotGit = true;
|
|
postFetch = ''
|
|
cd "$out"
|
|
git rev-parse --short HEAD > $out/COMMIT
|
|
find "$out" -name .git -print0 | xargs -0 rm -rf
|
|
'';
|
|
};
|
|
|
|
vendorHash = "sha256-pQK3cRNxvGm+NH4zBlw8jm+fPgSg65FIe7zxZ99jl5Q=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.version=${finalAttrs.version}"
|
|
];
|
|
|
|
preBuild = ''
|
|
ldflags+=" -X main.commit=$(cat COMMIT)"
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
makeBinaryWrapper
|
|
];
|
|
|
|
subPackages = [ "cmd/glab" ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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)
|
|
|
|
wrapProgram $out/bin/glab \
|
|
--set-default GLAB_CHECK_UPDATE 0 \
|
|
--set-default GLAB_SEND_TELEMETRY 0
|
|
'';
|
|
|
|
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
|
|
|
|
preCheck = ''
|
|
git init
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
nativeInstallCheckInputs = [
|
|
gitMinimal
|
|
versionCheckHook
|
|
writableTmpDirAsHomeHook
|
|
];
|
|
versionCheckProgramArg = "version";
|
|
versionCheckKeepEnvironment = [ "HOME" ];
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "GitLab CLI tool bringing GitLab to your command line";
|
|
license = lib.licenses.mit;
|
|
homepage = "https://gitlab.com/gitlab-org/cli";
|
|
changelog = "https://gitlab.com/gitlab-org/cli/-/releases/v${finalAttrs.version}";
|
|
maintainers = with lib.maintainers; [
|
|
freezeboy
|
|
luftmensch-luftmensch
|
|
anthonyroussel
|
|
];
|
|
mainProgram = "glab";
|
|
};
|
|
})
|