depot/third_party/nixpkgs/pkgs/development/tools/vultr-cli/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

35 lines
1.1 KiB
Nix

{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "vultr-cli";
version = "3.1.0";
src = fetchFromGitHub {
owner = "vultr";
repo = pname;
rev = "v${version}";
hash = "sha256-Ur+zqoO824EHiVC5hW0twhxk5yRbKruqcQtLBOe7PXE=";
};
vendorHash = "sha256-fryHPFIgpuW05AwGozjefa+Nogh0gEOTh2C/JLrOm8Y=";
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";
};
}