Skip to content

Commit

Permalink
chore(kubectx): pin v0.8.0 for multi-config support
Browse files Browse the repository at this point in the history
  • Loading branch information
z0al committed Jul 31, 2023
1 parent a271392 commit 6941775
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
4 changes: 4 additions & 0 deletions home/cli/kubectl.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ in
kubectx
];

programs.starship.settings = {
kubernetes.disabled = false;
};

d.fs.persisted = {
directories = [ ".kube" ];
};
Expand Down
4 changes: 4 additions & 0 deletions home/cli/starship/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
./themes.nix
];

home.sessionVariables = {
STARSHIP_LOG = "error";
};

programs.starship = {
enable = true;

Expand Down
58 changes: 58 additions & 0 deletions overlays/kubectx.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
channels: final: prev:

with final;
with final.lib;

{
__dontExport = true;

kubectx = stdenv.mkDerivation rec {
pname = "kubectx";
version = "0.8.0";

src = fetchFromGitHub {
owner = "ahmetb";
repo = pname;
rev = "v${version}";
sha256 = "1wkvmic29mkzfs6619wjs3mya8ffigwv9n1w9y7zkfvpi8gxa0a6";
};

buildInputs = [ makeWrapper ];

dontBuild = true;
doCheck = false;

installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/zsh/site-functions
mkdir -p $out/share/bash-completion/completions
mkdir -p $out/share/fish/vendor_completions.d
cp kubectx $out/bin
cp kubens $out/bin
# Provide ZSH completions
cp completion/kubectx.zsh $out/share/zsh/site-functions/_kubectx
cp completion/kubens.zsh $out/share/zsh/site-functions/_kubens
# Provide BASH completions
cp completion/kubectx.bash $out/share/bash-completion/completions/kubectx
cp completion/kubens.bash $out/share/bash-completion/completions/kubens
# Provide FISH completions
cp completion/*.fish $out/share/fish/vendor_completions.d/
for f in $out/bin/*; do
wrapProgram $f --prefix PATH : ${makeBinPath [ channels.unstable.kubectl ]}
done
'';

meta = {
description = "Fast way to switch between clusters and namespaces in kubectl!";
license = licenses.asl20;
homepage = https://github.com/ahmetb/kubectx;
maintainers = with maintainers; [ periklis ];
platforms = with platforms; unix;
};
};
}

0 comments on commit 6941775

Please sign in to comment.