1{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
2
3buildGoModule rec {
4 pname = "circleci-cli";
5 version = "0.1.30549";
6
7 src = fetchFromGitHub {
8 owner = "CircleCI-Public";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-dzKMj1JKalbdID113cfFA1hbOW7PQk3pfJaRqIJdpts=";
12 };
13
14 vendorHash = "sha256-60edYYhbSPiJWmuQXXEt+xCnSxsHf8Q38RgyWwdP6vQ=";
15
16 nativeBuildInputs = [ installShellFiles ];
17
18 doCheck = false;
19
20 ldflags = [ "-s" "-w" "-X github.com/CircleCI-Public/circleci-cli/version.Version=${version}" "-X github.com/CircleCI-Public/circleci-cli/version.Commit=${src.rev}" "-X github.com/CircleCI-Public/circleci-cli/version.packageManager=nix" ];
21
22 postInstall = ''
23 mv $out/bin/circleci-cli $out/bin/circleci
24
25 installShellCompletion --cmd circleci \
26 --bash <(HOME=$TMPDIR $out/bin/circleci completion bash --skip-update-check) \
27 --zsh <(HOME=$TMPDIR $out/bin/circleci completion zsh --skip-update-check)
28 '';
29
30 meta = with lib; {
31 # Box blurb edited from the AUR package circleci-cli
32 description = ''
33 Command to enable you to reproduce the CircleCI environment locally and
34 run jobs as if they were running on the hosted CirleCI application.
35 '';
36 maintainers = with maintainers; [ synthetica ];
37 mainProgram = "circleci";
38 license = licenses.mit;
39 homepage = "https://circleci.com/";
40 };
41}