1{ lib
2, buildGoModule
3, fetchFromGitHub
4, installShellFiles
5}:
6
7buildGoModule rec {
8 pname = "hcloud";
9 version = "1.38.3";
10
11 src = fetchFromGitHub {
12 owner = "hetznercloud";
13 repo = "cli";
14 rev = "refs/tags/v${version}";
15 hash = "sha256-argcQvt4875TNOX5P5sOF41u6GcFq79gnH41To73foM=";
16 };
17
18 vendorHash = "sha256-RXojFeT80oroBSweyb0eYo+LC/JTi1F3LmQ10XpnEXA=";
19
20 ldflags = [
21 "-s"
22 "-w"
23 "-X=github.com/hetznercloud/cli/internal/version.Version=${version}"
24 ];
25
26 nativeBuildInputs = [ installShellFiles ];
27
28 postInstall = ''
29 for shell in bash fish zsh; do
30 $out/bin/hcloud completion $shell > hcloud.$shell
31 installShellCompletion hcloud.$shell
32 done
33 '';
34
35 meta = with lib; {
36 changelog = "https://github.com/hetznercloud/cli/releases/tag/v${version}";
37 description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
38 homepage = "https://github.com/hetznercloud/cli";
39 license = licenses.mit;
40 maintainers = with maintainers; [ zauberpony techknowlogick ];
41 };
42}