nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, buildGoModule, fetchFromGitHub }:
2
3buildGoModule rec {
4 pname = "hcloud";
5 version = "1.14.0";
6
7 goPackagePath = "github.com/hetznercloud/cli";
8
9 src = fetchFromGitHub {
10 owner = "hetznercloud";
11 repo = "cli";
12 rev = "v${version}";
13 sha256 = "167x64ni4xm0d9b02gy8zvc8knhsvb1c9jhysw7svi7iaw5f2ds5";
14 };
15
16 modSha256 = "1g81szkrkxmv51l78v0d39i8dvrrdhf8wh38rwxvnay3iajgrnqk";
17
18 buildFlagsArray = [ "-ldflags=" "-w -X github.com/hetznercloud/cli/cli.Version=${version}" ];
19
20 postInstall = ''
21 mkdir -p \
22 $out/etc/bash_completion.d \
23 $out/share/zsh/vendor-completions
24
25 # Add bash completions
26 $out/bin/hcloud completion bash > "$out/etc/bash_completion.d/hcloud"
27
28 # Add zsh completions
29 echo "#compdef hcloud" > "$out/share/zsh/vendor-completions/_hcloud"
30 $out/bin/hcloud completion zsh >> "$out/share/zsh/vendor-completions/_hcloud"
31 '';
32
33 meta = {
34 description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
35 homepage = "https://github.com/hetznercloud/cli";
36 license = stdenv.lib.licenses.mit;
37 platforms = stdenv.lib.platforms.all;
38 maintainers = [ stdenv.lib.maintainers.zauberpony ];
39 };
40}