2020-06-27 10:20:00 +01:00
|
|
|
{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2018-02-02 23:36:02 +00:00
|
|
|
|
2019-12-01 13:03:15 +00:00
|
|
|
buildGoModule rec {
|
2019-07-30 11:12:24 +01:00
|
|
|
pname = "hcloud";
|
2020-06-26 12:23:24 +01:00
|
|
|
version = "1.17.0";
|
2019-07-30 10:20:46 +01:00
|
|
|
|
2018-02-02 23:36:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hetznercloud";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2020-06-26 12:23:24 +01:00
|
|
|
sha256 = "1brqqcyyljkdd24ljx2qbr648ihhhmr8mq6gs90n63r59ci6ksch";
|
2018-02-02 23:36:02 +00:00
|
|
|
};
|
|
|
|
|
2020-06-27 10:20:00 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-06-26 12:23:24 +01:00
|
|
|
vendorSha256 = "1m96j9cwqz2b67byf53qhgl3s0vfwaklj2pm8364qih0ilvifppj";
|
2018-10-17 22:23:56 +01:00
|
|
|
|
2020-08-04 01:26:27 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-06-27 10:20:00 +01:00
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X github.com/hetznercloud/cli/cli.Version=${version}" ];
|
2018-02-02 23:36:02 +00:00
|
|
|
|
2018-09-03 16:21:43 +01:00
|
|
|
postInstall = ''
|
2020-06-27 10:20:00 +01:00
|
|
|
for shell in bash zsh; do
|
|
|
|
$out/bin/hcloud completion $shell > hcloud.$shell
|
|
|
|
installShellCompletion hcloud.$shell
|
|
|
|
done
|
2018-09-03 16:21:43 +01:00
|
|
|
'';
|
|
|
|
|
2018-02-02 23:36:02 +00:00
|
|
|
meta = {
|
|
|
|
description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
|
2019-07-30 11:12:24 +01:00
|
|
|
homepage = "https://github.com/hetznercloud/cli";
|
2018-02-02 23:36:02 +00:00
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.zauberpony ];
|
|
|
|
};
|
2020-06-27 10:20:00 +01:00
|
|
|
}
|