2018-10-26 20:55:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2018-07-10 16:03:58 +00:00
|
|
|
|
2019-03-14 01:10:24 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "hetzner-kube";
|
2020-03-14 06:36:24 +00:00
|
|
|
version = "0.5.1";
|
2018-07-10 16:03:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xetys";
|
|
|
|
repo = "hetzner-kube";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2020-03-14 06:36:24 +00:00
|
|
|
sha256 = "1iqgpmljqx6rhmvsir2675waj78amcfiw08knwvlmavjgpxx2ysw";
|
2018-07-10 16:03:58 +00:00
|
|
|
};
|
|
|
|
|
2021-05-16 08:59:58 +00:00
|
|
|
patches = [
|
|
|
|
# Use $HOME instead of the OS user database.
|
|
|
|
# Upstream PR: https://github.com/xetys/hetzner-kube/pull/346
|
|
|
|
# Unfortunately, the PR patch does not apply against release.
|
|
|
|
./fix-home.patch
|
|
|
|
];
|
|
|
|
|
2020-05-01 01:59:00 +00:00
|
|
|
vendorSha256 = "1jh2f66ys6rmrrwrf5zqfprgcvziyq6l4z8bfqwxgf1ysnxx525h";
|
2018-07-10 16:03:58 +00:00
|
|
|
|
2020-08-04 00:26:27 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X github.com/xetys/hetzner-kube/cmd.version=${version}"
|
|
|
|
];
|
2019-03-14 01:24:04 +00:00
|
|
|
|
2018-10-26 20:55:03 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-05-16 08:59:58 +00:00
|
|
|
# Need a writable home, because it fails if unable to write config.
|
|
|
|
export HOME=$TMP
|
2018-10-26 20:55:03 +00:00
|
|
|
$out/bin/hetzner-kube completion bash > hetzner-kube
|
|
|
|
$out/bin/hetzner-kube completion zsh > _hetzner-kube
|
|
|
|
installShellCompletion --zsh _hetzner-kube
|
|
|
|
installShellCompletion --bash hetzner-kube
|
|
|
|
'';
|
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = {
|
2018-07-10 16:03:58 +00:00
|
|
|
description = "A CLI tool for provisioning Kubernetes clusters on Hetzner Cloud";
|
2020-03-14 06:36:24 +00:00
|
|
|
homepage = "https://github.com/xetys/hetzner-kube";
|
2020-03-27 07:33:21 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ eliasp ];
|
|
|
|
platforms = lib.platforms.unix;
|
2018-07-10 16:03:58 +00:00
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|