nixpkgs/pkgs/development/tools/metal-cli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-04 16:53:33 +00:00
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
2021-10-25 17:34:31 +00:00
buildGoModule rec {
pname = "metal-cli";
2023-12-27 04:15:23 +00:00
version = "0.19.0";
2021-10-25 17:34:31 +00:00
src = fetchFromGitHub {
owner = "equinix";
repo = pname;
rev = "v${version}";
2023-12-27 04:15:23 +00:00
hash = "sha256-S3/VKK+ab6RMuhqP1RRQK7ATcZn37Nws3ya3v9ujZ5M=";
2021-10-25 17:34:31 +00:00
};
2023-12-27 04:15:23 +00:00
vendorHash = "sha256-tu3AryadBbvQzYCEefGAWOnpEki3VJVxFZAseHrXhD4=";
2022-04-20 16:48:11 +00:00
2022-02-09 16:01:32 +00:00
ldflags = [
2022-12-04 16:53:33 +00:00
"-s"
"-w"
2022-02-09 16:01:32 +00:00
"-X github.com/equinix/metal-cli/cmd.Version=${version}"
];
2022-12-04 16:53:33 +00:00
nativeBuildInputs = [
installShellFiles
];
2022-09-21 23:10:17 +00:00
postInstall = ''
installShellCompletion --cmd metal \
--bash <($out/bin/metal completion bash) \
--fish <($out/bin/metal completion fish) \
--zsh <($out/bin/metal completion zsh)
'';
2021-10-25 17:34:31 +00:00
doCheck = false;
2022-04-20 16:48:11 +00:00
doInstallCheck = true;
2022-12-04 16:53:33 +00:00
2022-04-20 16:48:11 +00:00
installCheckPhase = ''
$out/bin/metal --version | grep ${version}
'';
2021-10-25 17:34:31 +00:00
meta = with lib; {
description = "Official Equinix Metal CLI";
homepage = "https://github.com/equinix/metal-cli/";
2022-12-04 16:53:33 +00:00
changelog = "https://github.com/equinix/metal-cli/releases/tag/v${version}";
2021-10-25 17:34:31 +00:00
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne nshalman ];
mainProgram = "metal";
2021-10-25 17:34:31 +00:00
};
}