Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
versionCheckHook,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "metal-cli";
|
|
version = "0.26.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "equinix";
|
|
repo = "metal-cli";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-o2CXcwGowmQ4/BBXZXbR0uJ0AOARj2KbKhhtlRr7qpM=";
|
|
};
|
|
|
|
vendorHash = "sha256-oAghUkEhOkpCfRkDF+/Tfo45ihbXJabRkk7J3ghP36I=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/equinix/metal-cli/cmd.Version=${finalAttrs.version}"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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;
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgram = "${placeholder "out"}/bin/metal";
|
|
versionCheckProgramArg = "--version";
|
|
|
|
meta = {
|
|
description = "Official Equinix Metal CLI";
|
|
homepage = "https://github.com/equinix/metal-cli/";
|
|
changelog = "https://github.com/equinix/metal-cli/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
Br1ght0ne
|
|
teutat3s
|
|
];
|
|
mainProgram = "metal";
|
|
};
|
|
})
|