2021-01-25 08:26:54 +00:00
|
|
|
{ lib, 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";
|
2022-07-28 15:02:01 +01:00
|
|
|
version = "1.30.1";
|
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}";
|
2022-07-28 15:02:01 +01:00
|
|
|
sha256 = "sha256-0zVbk8NuPGYyEcYV1F1if8VdKa4MnW2v+VQcvgM9bZ8=";
|
2018-02-02 23:36:02 +00:00
|
|
|
};
|
|
|
|
|
2022-07-28 15:02:01 +01:00
|
|
|
vendorSha256 = "sha256-++uvg/vXRX2lPU4CmqAcLWbsWBXZHXaXO4qXEaq90T4=";
|
2018-10-17 22:23:56 +01:00
|
|
|
|
2022-04-25 23:08:54 +01:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
2022-04-26 14:21:52 +01:00
|
|
|
"-X github.com/hetznercloud/cli/internal/version.Version=${version}"
|
2022-04-25 23:08:54 +01:00
|
|
|
];
|
2020-08-04 01:26:27 +01:00
|
|
|
|
2022-04-25 23:08:54 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2018-02-02 23:36:02 +00:00
|
|
|
|
2018-09-03 16:21:43 +01:00
|
|
|
postInstall = ''
|
2022-07-06 13:28:46 +01:00
|
|
|
for shell in bash fish zsh; do
|
2020-06-27 10:20:00 +01:00
|
|
|
$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";
|
2021-01-23 12:26:19 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.zauberpony ];
|
2018-02-02 23:36:02 +00:00
|
|
|
};
|
2020-06-27 10:20:00 +01:00
|
|
|
}
|