2023-08-28 08:20:23 +01: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";
|
2024-07-27 21:03:56 +01:00
|
|
|
version = "1.46.0";
|
2019-07-30 10:20:46 +01:00
|
|
|
|
2018-02-02 23:36:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hetznercloud";
|
|
|
|
repo = "cli";
|
2023-08-28 08:20:23 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 21:03:56 +01:00
|
|
|
hash = "sha256-xW0M4ppbW6yD5+JpJZnDVf2mPiBzNFotP1IPTbnJoC4=";
|
2018-02-02 23:36:02 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 21:03:56 +01:00
|
|
|
vendorHash = "sha256-XocfpUmq/w/gqhCaT4Y33uQaggx3Bm16QuG/bGdxmg4=";
|
2018-10-17 22:23:56 +01:00
|
|
|
|
2022-04-25 23:08:54 +01:00
|
|
|
ldflags = [
|
2023-08-28 08:20:23 +01:00
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-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
|
|
|
'';
|
|
|
|
|
2023-10-24 07:34:00 +01:00
|
|
|
meta = with lib; {
|
2023-04-12 12:47:46 +01:00
|
|
|
changelog = "https://github.com/hetznercloud/cli/releases/tag/v${version}";
|
2018-02-02 23:36:02 +00:00
|
|
|
description = "Command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "hcloud";
|
2019-07-30 11:12:24 +01:00
|
|
|
homepage = "https://github.com/hetznercloud/cli";
|
2023-10-24 07:34:00 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zauberpony techknowlogick ];
|
2018-02-02 23:36:02 +00:00
|
|
|
};
|
2020-06-27 10:20:00 +01:00
|
|
|
}
|