depot/third_party/nixpkgs/pkgs/development/tools/hcloud/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

36 lines
954 B
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "hcloud";
version = "1.30.4";
src = fetchFromGitHub {
owner = "hetznercloud";
repo = "cli";
rev = "v${version}";
sha256 = "sha256-282DJegj4lf7oynkdjNC6/PVvQaFbIqOJViua83KTdg=";
};
vendorSha256 = "sha256-Y2HlY8u2ZFtkAyYG7jqm+DMOFsWSQ6TxI7dm2woGA/Y=";
ldflags = [
"-s" "-w"
"-X github.com/hetznercloud/cli/internal/version.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
for shell in bash fish zsh; do
$out/bin/hcloud completion $shell > hcloud.$shell
installShellCompletion hcloud.$shell
done
'';
meta = {
description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
homepage = "https://github.com/hetznercloud/cli";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.zauberpony ];
};
}