nixpkgs/pkgs/development/tools/vultr-cli/default.nix
2023-12-09 18:02:22 +00:00

35 lines
1,004 B
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "vultr-cli";
version = "2.21.0";
src = fetchFromGitHub {
owner = "vultr";
repo = pname;
rev = "v${version}";
hash = "sha256-sIxAl4mI29RfJbGk/pvCSxUva8O9sXcwEIWBfY+h72Q=";
};
vendorHash = "sha256-d4EK9SLmIyt/N+29a7p7nxHkX0m0pAOMH7+G1tLbJGk=";
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";
};
}