summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/kubernetes/kubectl.nix
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-02-26 21:04:25 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-02-26 21:04:25 -0300
commited2b1b4b909538716abb6378971ba75fae65b7d2 (patch)
tree25c9f8f505f3ad7d3955c556a50ef6c111e7c369 /pkgs/applications/networking/cluster/kubernetes/kubectl.nix
parentf68dbdc7c39faa5f685e34b10da0b373ad6a7c22 (diff)
parent2970b27faf15840714feba50186e7e02d945569f (diff)
downloadnixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.gz
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.bz2
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.lz
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.xz
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.zst
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.zip
Merge branch 'master' into staging-next
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;
   };
 }