1{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2
3buildGoModule rec {
4 pname = "vultr-cli";
5 version = "2.20.0";
6
7 src = fetchFromGitHub {
8 owner = "vultr";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-3Zd507yAymmQRgybm96VD413kId0/kMxIHbmUh8j6Kk=";
12 };
13
14 vendorHash = "sha256-OVoOCExAU6cDyWhSpk4hkhBZpWehH+4/vU/X81w9XgA=";
15
16 nativeBuildInputs = [ installShellFiles ];
17
18 ldflags = [ "-s" "-w" ];
19
20 postInstall = ''
21 installShellCompletion --cmd vultr-cli \
22 --bash <($out/bin/vultr-cli completion bash) \
23 --fish <($out/bin/vultr-cli completion fish) \
24 --zsh <($out/bin/vultr-cli completion zsh)
25 '';
26
27 meta = with lib; {
28 description = "Official command line tool for Vultr services";
29 homepage = "https://github.com/vultr/vultr-cli";
30 changelog = "https://github.com/vultr/vultr-cli/blob/v${version}/CHANGELOG.md";
31 license = licenses.asl20;
32 maintainers = with maintainers; [ Br1ght0ne ];
33 mainProgram = "vultr-cli";
34 };
35}