blob: f395e177d0ccb02ff5ebac651196af2236d410bd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "metal-cli";
version = "0.23.1";
src = fetchFromGitHub {
owner = "equinix";
repo = pname;
rev = "v${version}";
hash = "sha256-EuwLsrLwTM3FsUt1oa4N9y5Vq8TjTXQW+5UArXZHxuc=";
};
vendorHash = "sha256-X+GfM73LAWk2pT4ZOPT2pg8YaKyT+SNjQ14LgB+C7Wo=";
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/";
changelog = "https://github.com/equinix/metal-cli/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne nshalman teutat3s ];
mainProgram = "metal";
};
}
|