2020-12-01 22:46:57 +00:00
|
|
|
{ stdenv, kubernetes, installShellFiles }:
|
2019-01-19 19:27:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "kubectl-${kubernetes.version}";
|
|
|
|
|
|
|
|
# kubectl is currently part of the main distribution but will eventially be
|
|
|
|
# split out (see homepage)
|
2020-12-01 22:46:57 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2019-01-19 19:27:51 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-12-01 22:46:57 +00:00
|
|
|
install -D ${kubernetes}/bin/kubectl -t $out/bin
|
2019-01-19 19:27:51 +00:00
|
|
|
|
2020-12-01 22:46:57 +00:00
|
|
|
installManPage "${kubernetes.man}/share/man/man1"/kubectl*
|
2019-01-19 19:27:51 +00:00
|
|
|
|
2020-12-01 22:46:57 +00:00
|
|
|
installShellCompletion --cmd kubectl \
|
|
|
|
--bash <($out/bin/kubectl completion bash) \
|
|
|
|
--zsh <($out/bin/kubectl completion zsh)
|
2019-01-19 19:27:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = kubernetes.meta // {
|
|
|
|
description = "Kubernetes CLI";
|
|
|
|
homepage = "https://github.com/kubernetes/kubectl";
|
|
|
|
};
|
|
|
|
}
|