mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
29 lines
729 B
Nix
29 lines
729 B
Nix
{ stdenv, kubernetes, installShellFiles }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "kubectl-${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";
|
|
};
|
|
}
|