5083ee08a2
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "metal-cli";
|
|
version = "0.10.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "equinix";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-bXea270m0+JAQ3j+JhkiVNds2X7rogcIqJIqRK7DS2g=";
|
|
};
|
|
|
|
vendorSha256 = "sha256-bCVHPpdQSlEU7smoQzpiLZMQVPUQO8UhylrpDf0MSmk=";
|
|
|
|
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";
|
|
};
|
|
}
|