feat: more ricing to the devcontainer

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2024-01-24 09:04:29 -05:00
1 parent 40aeae150d
commit 9f2d6a9970
2 files changed
+56 -54

No files matched your search

+47 -19
View File
@@ -1,43 +1,71 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
set -o noglob
ARCH="$(uname -m)"
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
fi
#
# Install Tools from the Alpine Repositories
#
apk add --no-cache \
bash bind-tools ca-certificates curl python3 \
py3-pip moreutils jq git iputils \
openssh-client starship
openssh-client starship fzf
apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
age direnv fish helm kubectl kustomize sops yq
age direnv fish helm kubectl kustomize sops
#
# Install Tools not in Alpine Repositories
#
sudo apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \
lsd
for installer_path in \
"budimanjojo/talhelper!" \
"cilium/cilium-cli!!?as=cilium" \
"cli/cli!!?as=gh" \
"cloudflare/cloudflared!" \
"derailed/k9s!" \
"fluxcd/flux2!!?as=flux" \
"go-task/task!" \
"k0sproject/k0sctl!" \
"derailed/k9s!" \
"kubecolor/kubecolor!" \
"stern/stern!" \
"siderolabs/talos!!?as=talosctl" \
"yannh/kubeconform!"
"yannh/kubeconform!" \
"mikefarah/yq!"
do
curl -fsSL "https://i.jpillora.com/${installer_path}" | bash
done
# Create the fish configuration directory
mkdir -p /home/vscode/.config/fish/{completions,conf.d}
# Setup autocompletions for fish
for tool in cilium flux helm k9s kubectl kustomize talhelper talosctl; do
$tool completion fish > /home/vscode/.config/fish/completions/$tool.fish
done
gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish
k0sctl completion --shell fish > /home/vscode/.config/fish/completions/k0sctl.fish
stern --completion fish > /home/vscode/.config/fish/completions/stern.fish
yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish
# Add hooks into fish
tee /home/vscode/.config/fish/conf.d/hooks.fish > /dev/null <<EOF
if status is-interactive
direnv hook fish | source
starship init fish | source
end
EOF
# Add aliases into fish
tee /home/vscode/.config/fish/conf.d/aliases.fish > /dev/null <<EOF
alias ls lsd
alias kubectl kubecolor
alias k kubectl
EOF
# Custom fish prompt
tee /home/vscode/.config/fish/conf.d/fish_greeting.fish > /dev/null <<EOF
function fish_greeting
echo (set_color yellow)"Welcome! Press [enter] to clear the direnv error"
end
EOF
# Set ownership of fish directory to the vscode user
chown -R vscode:vscode /home/vscode/.config/fish
+9 -35
View File
@@ -2,41 +2,15 @@
set -e
set -o noglob
# Create the fish configuration directory
mkdir -p ~/.config/fish/{completions,conf.d}
# Hook direnv into fish
tee ~/.config/fish/conf.d/direnv.fish > /dev/null <<EOF
direnv hook fish | source
EOF
# Hook starship into fish
tee ~/.config/fish/conf.d/starship.fish > /dev/null <<EOF
starship init fish | source
EOF
# Silence fish prompt
tee ~/.config/fish/conf.d/fish_greeting.fish > /dev/null <<EOF
function fish_greeting
echo (set_color yellow)"Press [enter] to clear the direnv error"
end
EOF
# Setup fisher plugin manager for fish
/usr/bin/fish -c "curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher"
/usr/bin/fish -c "fisher install decors/fish-colored-man"
/usr/bin/fish -c "fisher install edc/bass"
/usr/bin/fish -c "fisher install jorgebucaran/autopair.fish"
/usr/bin/fish -c "fisher install nickeb96/puffer-fish"
# Setup CLI tools autocompletions for fish
for tool in cilium flux helm k9s kubectl kustomize talhelper talosctl; do
$tool completion fish > ~/.config/fish/completions/$tool.fish
done
gh completion --shell fish > ~/.config/fish/completions/gh.fish
k0sctl completion --shell fish > ~/.config/fish/completions/k0sctl.fish
stern --completion fish > ~/.config/fish/completions/stern.fish
yq shell-completion fish > ~/.config/fish/completions/yq.fish
# Setup fisher plugin manager for fish and install plugins
/usr/bin/fish -c "
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
fisher install decors/fish-colored-man
fisher install edc/bass
fisher install jorgebucaran/autopair.fish
fisher install nickeb96/puffer-fish
fisher install PatrickF1/fzf.fish
"
# Create/update virtual environment
if ! grep -q "venv /workspaces/" .venv/pyvenv.cfg; then