3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
2022-01-24 08:58:47 +10:00

30 lines
740 B
Nix

{ 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)
dontUnpack = true;
nativeBuildInputs = [ installShellFiles ];
outputs = [ "out" "man" ];
installPhase = ''
install -D ${kubernetes}/bin/kubectl -t $out/bin
installManPage "${kubernetes.man}/share/man/man1"/kubectl*
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";
};
}