about summary refs log tree commit diff
path: root/pkgs/tools/admin/credhub-cli
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2020-12-21 16:51:08 +0000
committerRobert Scott <code@humanleg.org.uk>2020-12-25 12:30:43 +0000
commitc5760e46681535a83fefa121d3ff84c508409e1b (patch)
tree3e713d801a910dc76db94c863ec7dbc997c9ff9e /pkgs/tools/admin/credhub-cli
parent5ba85d6b34736da4ee3caba8e89c596f17e14a83 (diff)
credhub-cli: init at 2.9.0
Diffstat (limited to 'pkgs/tools/admin/credhub-cli')
-rw-r--r--pkgs/tools/admin/credhub-cli/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/tools/admin/credhub-cli/default.nix b/pkgs/tools/admin/credhub-cli/default.nix
new file mode 100644
index 0000000000000..f3cc5141618b9
--- /dev/null
+++ b/pkgs/tools/admin/credhub-cli/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "credhub-cli";
+  version = "2.9.0";
+
+  src = fetchFromGitHub {
+    owner = "cloudfoundry-incubator";
+    repo = "credhub-cli";
+    rev = version;
+    sha256 = "1j0i0b79ph2i52cj0qln8wvp6gwhl73akkn026h27vvmlw9sndc2";
+  };
+
+  # these tests require network access that we're not going to give them
+  postPatch = ''
+    rm commands/api_test.go
+    rm commands/socks5_test.go
+  '';
+  __darwinAllowLocalNetworking = true;
+
+  vendorSha256 = null;
+
+  buildFlagsArray = [
+    "-ldflags="
+    "-s"
+    "-w"
+    "-X code.cloudfoundry.org/credhub-cli/version.Version=${version}"
+  ];
+
+  postInstall = ''
+    ln -s $out/bin/credhub-cli $out/bin/credhub
+  '';
+
+  preCheck = ''
+    export HOME=$TMPDIR
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Provides a command line interface to interact with CredHub servers";
+    homepage = "https://github.com/cloudfoundry-incubator/credhub-cli";
+    maintainers = with maintainers; [ ris ];
+    license = licenses.asl20;
+  };
+}