Skip to content

Commit cef4cb3

Browse files
authored
feat: kubectx and stern to nix devshell (#30)
The main README recommends to install kubectx and stern as additional utilities. To be consistent, I'd suggest to include these in the nix devshell. Since we're installing kubectx, this PR also sets up one-letter aliases for kubectx and kubens. Signed-off-by: Jeremy Schneider <[email protected]>
1 parent ae93e2a commit cef4cb3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

flake.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
alias k=kubectl
1919
complete -o default -F __start_kubectl k
2020
21+
# setup 'c/n' as 'kubectx/kubens' aliases
22+
source /nix/store/*-kubectx-*/share/bash-completion/completions/kubectx.bash
23+
alias c=kubectx
24+
complete -F _kube_contexts c
25+
source /nix/store/*-kubectx-*/share/bash-completion/completions/kubens.bash
26+
alias n=kubens
27+
complete -F _kube_namespaces n
28+
2129
# Setup 'kc' as a 'kubectl cnpg' alias
2230
source <(kubectl cnpg completion bash)
2331
alias kc="kubectl cnpg"
@@ -26,12 +34,14 @@
2634

2735
packages = [
2836
pkgs.kubectl
37+
pkgs.kubectx
2938
pkgs.kubernetes-helm
3039
pkgs.kind
3140
pkgs.jq
3241
pkgs.curl
3342
pkgs.kubectl-cnpg
3443
pkgs.kubectl-view-secret
44+
pkgs.stern
3545
pkgs.cmctl
3646
pkgs.k9s
3747
pkgs.lazydocker

0 commit comments

Comments
 (0)