mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
22 lines
555 B
Nix
22 lines
555 B
Nix
|
{ config, pkgs, lib, ... }:
|
||
|
{
|
||
|
programs.bash.interactiveShellInit = ''
|
||
|
kc(){
|
||
|
export KUBECONFIG=~/.kube/config."$1"
|
||
|
kubectl get nodes
|
||
|
}
|
||
|
_kc_completion(){
|
||
|
[ "''${#COMP_WORDS[@]}" != "2" ] ||
|
||
|
COMPREPLY=($(compgen -W "$(ls ~/.kube/ | grep '^config\.' | sed 's/^config\.//g')" -- "''${COMP_WORDS[1]}"))
|
||
|
}
|
||
|
complete -F _kc_completion kc
|
||
|
source <(kubectl completion bash)
|
||
|
complete -F __start_kubectl k
|
||
|
alias k=kubectl
|
||
|
'';
|
||
|
environment.systemPackages = [
|
||
|
pkgs.kubectl
|
||
|
pkgs.kubernetes-helm
|
||
|
];
|
||
|
}
|