nixpkgs/pkgs/by-name/ci/cirrus-cli/package.nix
2024-09-21 01:20:40 +00:00

44 lines
1.1 KiB
Nix

{ lib
, fetchFromGitHub
, buildGoModule
, installShellFiles
}:
buildGoModule rec {
pname = "cirrus-cli";
version = "0.126.1";
src = fetchFromGitHub {
owner = "cirruslabs";
repo = pname;
rev = "v${version}";
hash = "sha256-A894AUmsJjCCvN6cI2qoTPyOeQx6h2uukzxtlvWZVn8=";
};
vendorHash = "sha256-PecNBlSoo8WN2FKXN/UpkqpqbsJkOPHKILy76YWgNlw=";
ldflags = [
"-X github.com/cirruslabs/cirrus-cli/internal/version.Version=v${version}"
"-X github.com/cirruslabs/cirrus-cli/internal/version.Commit=v${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd cirrus \
--bash <($out/bin/cirrus completion bash) \
--zsh <($out/bin/cirrus completion zsh) \
--fish <($out/bin/cirrus completion fish)
'';
# tests fail on read-only filesystem
doCheck = false;
meta = with lib; {
description = "CLI for executing Cirrus tasks locally and in any CI";
homepage = "https://github.com/cirruslabs/cirrus-cli";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ techknowlogick ];
mainProgram = "cirrus";
};
}