2024-04-21 15:54:59 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "vultr-cli";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "3.3.0";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vultr";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-Gn2N/v3qFqxI2ZU94GNuzpHoXgPeJaAO+ODjb5ff1aI=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-kglG6Mhe1XUqblt+0ZR8FPPTrBKjxb1xG8bPXQrrzxE=";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2023-10-09 19:29:22 +00:00
|
|
|
installShellCompletion --cmd vultr-cli \
|
|
|
|
--bash <($out/bin/vultr-cli completion bash) \
|
|
|
|
--fish <($out/bin/vultr-cli completion fish) \
|
|
|
|
--zsh <($out/bin/vultr-cli completion zsh)
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-05-29 06:06:01 +00:00
|
|
|
description = "Official command line tool for Vultr services";
|
|
|
|
homepage = "https://github.com/vultr/vultr-cli";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/vultr/vultr-cli/blob/v${version}/CHANGELOG.md";
|
2020-05-29 06:06:01 +00:00
|
|
|
license = licenses.asl20;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "vultr-cli";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|