summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/cluster/kubernetes/kubectl.nix')
-rw-r--r--pkgs/applications/networking/cluster/kubernetes/kubectl.nix28
1 files changed, 18 insertions, 10 deletions
diff --git a/pkgs/applications/networking/cluster/kubernetes/kubectl.nix b/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
index fec93d8878e..b1c15458543 100644
--- a/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
+++ b/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
@@ -1,29 +1,37 @@
-{ stdenv, kubernetes, installShellFiles }:
+{ lib, stdenv, kubernetes }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   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 ];
+  inherit (kubernetes)
+    disallowedReferences
+    GOFLAGS
+    nativeBuildInputs
+    postBuild
+    postPatch
+    src
+    version
+    ;
 
   outputs = [ "out" "man" ];
 
+  WHAT = "cmd/kubectl";
+
   installPhase = ''
-    install -D ${kubernetes}/bin/kubectl -t $out/bin
+    runHook preInstall
+    install -D _output/local/go/bin/kubectl -t $out/bin
 
-    installManPage "${kubernetes.man}/share/man/man1"/kubectl*
+    installManPage docs/man/man1/kubectl*
 
     installShellCompletion --cmd kubectl \
       --bash <($out/bin/kubectl completion bash) \
       --zsh <($out/bin/kubectl completion zsh)
+    runHook postInstall
   '';
 
   meta = kubernetes.meta // {
     description = "Kubernetes CLI";
     homepage = "https://github.com/kubernetes/kubectl";
+    platforms = lib.platforms.unix;
   };
 }