depot/third_party/nixpkgs/pkgs/development/tools/metal-cli/default.nix
Default email d2947cfef0 Project import generated by Copybara.
GitOrigin-RevId: 598f83ebeb2235435189cf84d844b8b73e858e0f
2022-10-06 20:32:54 +02:00

44 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "metal-cli";
version = "0.10.2";
src = fetchFromGitHub {
owner = "equinix";
repo = pname;
rev = "v${version}";
sha256 = "sha256-DjsJ/pJu62hn89KhOgQAT5gZcMD+5fF4IXU0PL7Pzdo=";
};
vendorSha256 = "sha256-eH/T5KlFvZx7sCZHLn0GNIAwTizLglvv9BoDndcJivo=";
ldflags = [
"-s" "-w"
"-X github.com/equinix/metal-cli/cmd.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd metal \
--bash <($out/bin/metal completion bash) \
--fish <($out/bin/metal completion fish) \
--zsh <($out/bin/metal completion zsh)
'';
doCheck = false;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/metal --version | grep ${version}
'';
meta = with lib; {
description = "Official Equinix Metal CLI";
homepage = "https://github.com/equinix/metal-cli/";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne nshalman ];
mainProgram = "metal";
};
}