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