3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/kubectl/default.nix

30 lines
740 B
Nix
Raw Normal View History

2020-12-01 22:46:57 +00:00
{ stdenv, kubernetes, installShellFiles }:
stdenv.mkDerivation {
pname = "kubectl";
version = 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 ];
outputs = [ "out" "man" ];
installPhase = ''
2020-12-01 22:46:57 +00:00
install -D ${kubernetes}/bin/kubectl -t $out/bin
2020-12-01 22:46:57 +00:00
installManPage "${kubernetes.man}/share/man/man1"/kubectl*
2020-12-01 22:46:57 +00:00
installShellCompletion --cmd kubectl \
--bash <($out/bin/kubectl completion bash) \
--zsh <($out/bin/kubectl completion zsh)
'';
meta = kubernetes.meta // {
description = "Kubernetes CLI";
homepage = "https://github.com/kubernetes/kubectl";
};
}