2022-02-15 23:35:25 +00:00
|
|
|
{ lib, stdenv, kubernetes }:
|
2019-01-19 19:27:51 +00:00
|
|
|
|
2022-02-15 23:35:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-07-12 10:51:53 +00:00
|
|
|
pname = "kubectl";
|
2019-01-19 19:27:51 +00:00
|
|
|
|
2022-02-15 23:35:25 +00:00
|
|
|
inherit (kubernetes)
|
|
|
|
disallowedReferences
|
|
|
|
GOFLAGS
|
|
|
|
nativeBuildInputs
|
|
|
|
postBuild
|
|
|
|
postPatch
|
|
|
|
src
|
|
|
|
version
|
|
|
|
;
|
2019-01-19 19:27:51 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2022-02-15 23:35:25 +00:00
|
|
|
WHAT = "cmd/kubectl";
|
|
|
|
|
2019-01-19 19:27:51 +00:00
|
|
|
installPhase = ''
|
2022-02-15 23:35:25 +00:00
|
|
|
runHook preInstall
|
|
|
|
install -D _output/local/go/bin/kubectl -t $out/bin
|
2019-01-19 19:27:51 +00:00
|
|
|
|
2022-02-15 23:35:25 +00:00
|
|
|
installManPage docs/man/man1/kubectl*
|
2019-01-19 19:27:51 +00:00
|
|
|
|
2020-12-01 22:46:57 +00:00
|
|
|
installShellCompletion --cmd kubectl \
|
|
|
|
--bash <($out/bin/kubectl completion bash) \
|
|
|
|
--zsh <($out/bin/kubectl completion zsh)
|
2022-02-15 23:35:25 +00:00
|
|
|
runHook postInstall
|
2019-01-19 19:27:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = kubernetes.meta // {
|
|
|
|
description = "Kubernetes CLI";
|
|
|
|
homepage = "https://github.com/kubernetes/kubectl";
|
2022-02-15 23:35:25 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2019-01-19 19:27:51 +00:00
|
|
|
};
|
|
|
|
}
|