Skip to content

Commit

Permalink
Added shell completion settings
Browse files Browse the repository at this point in the history
  • Loading branch information
a1994sc committed May 25, 2024
1 parent fd56421 commit db33a20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let
sourceRoot = ".";
dontBuild = true;

nativeBuildInputs = [unzip ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
nativeBuildInputs = [ unzip ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];

installPhase = ''
runHook preInstall
Expand Down
10 changes: 9 additions & 1 deletion overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ final: prev: rec {
kubectlWrapper =
final.runCommand "kubectl-with-plugins-wrapper"
{
nativeBuildInputs = [ final.makeWrapper ];
nativeBuildInputs = [
final.makeWrapper
final.installShellFiles
];
meta.priority = final.kubectl.meta.priority or 0 + 10;
}
''
makeWrapper ${final.kubectl}/bin/kubectl $out/bin/kubectl --prefix PATH : ${final.lib.makeBinPath selectedPlugins}
installShellCompletion --cmd kubectl \
--bash <($out/bin/kubectl completion bash) \
--fish <($out/bin/kubectl completion fish) \
--zsh <($out/bin/kubectl completion zsh)
'';
in
final.buildEnv {
Expand Down

0 comments on commit db33a20

Please sign in to comment.