about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/kubernetes
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2022-01-08 16:53:59 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2022-01-24 08:58:47 +1000
commit2702a6999f32dbb202147451d5fa55fccd821bf9 (patch)
treeef23cd9e19875b6470e3d6adad28c7e5faf96988 /pkgs/applications/networking/cluster/kubernetes
parent5d18ae8459855d0a143d2ca0bc7929225b8602b6 (diff)
kubectl: move alongside kubernetes
Diffstat (limited to 'pkgs/applications/networking/cluster/kubernetes')
-rw-r--r--pkgs/applications/networking/cluster/kubernetes/kubectl.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/kubernetes/kubectl.nix b/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
new file mode 100644
index 0000000000000..fec93d8878e05
--- /dev/null
+++ b/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";
+  };
+}