@@ -0,0 +1,44 @@
1+{ stdenv, buildGoModule, fetchFromGitHub }:
2+
3+buildGoModule rec {
4+ pname = "credhub-cli";
5+ version = "2.9.0";
6+
7+ src = fetchFromGitHub {
8+ owner = "cloudfoundry-incubator";
9+ repo = "credhub-cli";
10+ rev = version;
11+ sha256 = "1j0i0b79ph2i52cj0qln8wvp6gwhl73akkn026h27vvmlw9sndc2";
12+ };
13+
14+ # these tests require network access that we're not going to give them
15+ postPatch = ''
16+ rm commands/api_test.go
17+ rm commands/socks5_test.go
18+ '';
19+ __darwinAllowLocalNetworking = true;
20+
21+ vendorSha256 = null;
22+
23+ buildFlagsArray = [
24+ "-ldflags="
25+ "-s"
26+ "-w"
27+ "-X code.cloudfoundry.org/credhub-cli/version.Version=${version}"
28+ ];
29+
30+ postInstall = ''
31+ ln -s $out/bin/credhub-cli $out/bin/credhub
32+ '';
33+
34+ preCheck = ''
35+ export HOME=$TMPDIR
36+ '';
37+
38+ meta = with stdenv.lib; {
39+ description = "Provides a command line interface to interact with CredHub servers";
40+ homepage = "https://github.com/cloudfoundry-incubator/credhub-cli";
41+ maintainers = with maintainers; [ ris ];
42+ license = licenses.asl20;
43+ };
44+}