nixpkgs/pkgs/development/tools/vultr-cli/default.nix
2023-10-23 14:41:54 +00:00

36 lines
1004 B
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "vultr-cli";
version = "2.19.0";
src = fetchFromGitHub {
owner = "vultr";
repo = pname;
rev = "v${version}";
hash = "sha256-RLJtDzG3dKaJkppJO/cAggvgB9egCxCWd1mbQ91KPuY=";
};
vendorHash = "sha256-lVZcmqEC4InZr2zcgI4WVg6Pl3Cv/crTWuLSnqY3Vyk=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [ "-s" "-w" ];
postInstall = ''
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";
};
}