summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/kubectl/default.nix
blob: fec93d8878e052e859d7f88e5f64ab97f1e4b8a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ 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";
  };
}