bcb2f287e1
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "vultr-cli";
|
|
version = "3.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "vultr";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-iMd/PXcLa3Z5yNsebub0MSZvionm6ERNlBJANvymP7Y=";
|
|
};
|
|
|
|
vendorHash = "sha256-sBG6T+wVEFvgNdPJt5Fe7SIzetkxAqGW7VgyXV7wUSs=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Official command line tool for Vultr services";
|
|
homepage = "https://github.com/vultr/vultr-cli";
|
|
changelog = "https://github.com/vultr/vultr-cli/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ Br1ght0ne ];
|
|
mainProgram = "vultr-cli";
|
|
};
|
|
}
|