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