about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix b/nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
new file mode 100644
index 000000000000..fec93d8878e0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
@@ -0,0 +1,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";
+  };
+}