2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "hcloud";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.36.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hetznercloud";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-BmV+g0Geue41KNcB++TaoSsuGG1HA+uH5GHye7QRWOM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = "sha256-eGeaH9nIjBSZLxNlsQtas122eEXrIbrGn/GYVB4KhvY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/hetznercloud/cli/internal/version.Version=${version}"
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postInstall = ''
|
2022-07-14 12:49:19 +00:00
|
|
|
for shell in bash fish zsh; do
|
2020-07-18 16:06:22 +00:00
|
|
|
$out/bin/hcloud completion $shell > hcloud.$shell
|
|
|
|
installShellCompletion hcloud.$shell
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/hetznercloud/cli/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
|
|
|
|
homepage = "https://github.com/hetznercloud/cli";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.zauberpony ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
}
|