kubernetes_shell.nix
· 952 B · Nix
Исходник
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
minikube
kubernetes-helm
bash-completion
jq
docker
just
sops # SOPS for secrets encryption/decryption
age # age encryption backend for SOPS
gnupg # for PGP/GPG support, if needed
kubectl # included separately for completions (supports minikube override/alias)
envsubst # for templating manifests, useful in CI/CD flows
];
shellHook = ''
echo "Development shell loaded."
# Enable kubectl completion
if command -v kubectl > /dev/null; then
source <(kubectl completion bash)
fi
# Enable helm completion
if command -v helm > /dev/null; then
source <(helm completion bash)
fi
# Alias kubectl to minikube kubectl for convenience
alias kubectl='minikube kubectl --'
echo "Type 'kubectl' to use the Minikube-provided kubectl."
'';
}
| 1 | { pkgs ? import <nixpkgs> {} }: |
| 2 | |
| 3 | pkgs.mkShell { |
| 4 | buildInputs = with pkgs; [ |
| 5 | minikube |
| 6 | kubernetes-helm |
| 7 | bash-completion |
| 8 | jq |
| 9 | docker |
| 10 | just |
| 11 | sops # SOPS for secrets encryption/decryption |
| 12 | age # age encryption backend for SOPS |
| 13 | gnupg # for PGP/GPG support, if needed |
| 14 | kubectl # included separately for completions (supports minikube override/alias) |
| 15 | envsubst # for templating manifests, useful in CI/CD flows |
| 16 | ]; |
| 17 | |
| 18 | shellHook = '' |
| 19 | echo "Development shell loaded." |
| 20 | |
| 21 | # Enable kubectl completion |
| 22 | if command -v kubectl > /dev/null; then |
| 23 | source <(kubectl completion bash) |
| 24 | fi |
| 25 | |
| 26 | # Enable helm completion |
| 27 | if command -v helm > /dev/null; then |
| 28 | source <(helm completion bash) |
| 29 | fi |
| 30 | |
| 31 | # Alias kubectl to minikube kubectl for convenience |
| 32 | alias kubectl='minikube kubectl --' |
| 33 | |
| 34 | echo "Type 'kubectl' to use the Minikube-provided kubectl." |
| 35 | ''; |
| 36 | } |
| 37 |