nixpkgs/pkgs/tools/admin/credhub-cli/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

45 lines
1 KiB
Nix

{ lib, 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 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;
};
}