1{
2 lib,
3 fetchFromGitHub,
4 buildGoModule,
5 installShellFiles,
6}:
7
8buildGoModule rec {
9 pname = "cirrus-cli";
10 version = "0.147.0";
11
12 src = fetchFromGitHub {
13 owner = "cirruslabs";
14 repo = "cirrus-cli";
15 rev = "v${version}";
16 hash = "sha256-krEgxsPEMNDagaiB14uaF2XzuK5WSoGauGYM/k6YaY4=";
17 };
18
19 vendorHash = "sha256-oG5RhpXsL8R5lqZEp+U4Biwnip7H1AjXM+fZIrS2pZc=";
20
21 ldflags = [
22 "-X github.com/cirruslabs/cirrus-cli/internal/version.Version=v${version}"
23 "-X github.com/cirruslabs/cirrus-cli/internal/version.Commit=v${version}"
24 ];
25
26 nativeBuildInputs = [ installShellFiles ];
27 postInstall = ''
28 installShellCompletion --cmd cirrus \
29 --bash <($out/bin/cirrus completion bash) \
30 --zsh <($out/bin/cirrus completion zsh) \
31 --fish <($out/bin/cirrus completion fish)
32 '';
33
34 # tests fail on read-only filesystem
35 doCheck = false;
36
37 meta = with lib; {
38 description = "CLI for executing Cirrus tasks locally and in any CI";
39 homepage = "https://github.com/cirruslabs/cirrus-cli";
40 license = licenses.agpl3Plus;
41 maintainers = with maintainers; [ techknowlogick ];
42 mainProgram = "cirrus";
43 };
44}