|
| 1 | +#!/usr/bin/env bash |
| 2 | +set -e |
| 3 | +set -o noglob |
| 4 | + |
| 5 | +apk add --no-cache \ |
| 6 | + bash bind-tools ca-certificates curl python3 \ |
| 7 | + py3-pip moreutils jq git iputils openssh-client \ |
| 8 | + starship fzf fish |
| 9 | + |
| 10 | +apk add --no-cache \ |
| 11 | + --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ |
| 12 | + age helm kubectl sops |
| 13 | + |
| 14 | +sudo apk add --no-cache \ |
| 15 | + --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ |
| 16 | + lsd |
| 17 | + |
| 18 | +for app in \ |
| 19 | + "budimanjojo/talhelper!" \ |
| 20 | + "cilium/cilium-cli!!?as=cilium&type=script" \ |
| 21 | + "cli/cli!!?as=gh&type=script" \ |
| 22 | + "cloudflare/cloudflared!!?as=cloudflared&type=script" \ |
| 23 | + "derailed/k9s!!?as=k9s&type=script" \ |
| 24 | + "direnv/direnv!!?as=direnv&type=script" \ |
| 25 | + "fluxcd/flux2!!?as=flux&type=script" \ |
| 26 | + "go-task/task!!?as=task&type=script" \ |
| 27 | + "helmfile/helmfile!!?as=helmfile&type=script" \ |
| 28 | + "kubecolor/kubecolor!!?as=kubecolor&type=script" \ |
| 29 | + "kubernetes-sigs/krew!!?as=krew&type=script" \ |
| 30 | + "kubernetes-sigs/kustomize!!?as=kustomize&type=script" \ |
| 31 | + "stern/stern!!?as=stern&type=script" \ |
| 32 | + "siderolabs/talos!!?as=talosctl&type=script" \ |
| 33 | + "yannh/kubeconform!!?as=kubeconform&type=script" \ |
| 34 | + "mikefarah/yq!!?as=yq&type=script" |
| 35 | +do |
| 36 | + echo "=== Installing ${app} ===" |
| 37 | + curl -fsSL "https://i.jpillora.com/${app}" | bash |
| 38 | +done |
| 39 | + |
| 40 | +# Create the fish configuration directory |
| 41 | +mkdir -p /home/vscode/.config/fish/{completions,conf.d} |
| 42 | + |
| 43 | +# Setup autocompletions for fish |
| 44 | +for tool in cilium flux helm helmfile k9s kubectl kustomize talhelper talosctl; do |
| 45 | + $tool completion fish > /home/vscode/.config/fish/completions/$tool.fish |
| 46 | +done |
| 47 | +gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish |
| 48 | +stern --completion fish > /home/vscode/.config/fish/completions/stern.fish |
| 49 | +yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish |
| 50 | + |
| 51 | +# Add hooks into fish |
| 52 | +tee /home/vscode/.config/fish/conf.d/hooks.fish > /dev/null <<EOF |
| 53 | +if status is-interactive |
| 54 | + direnv hook fish | source |
| 55 | + starship init fish | source |
| 56 | +end |
| 57 | +EOF |
| 58 | + |
| 59 | +# Add aliases into fish |
| 60 | +tee /home/vscode/.config/fish/conf.d/aliases.fish > /dev/null <<EOF |
| 61 | +alias ls lsd |
| 62 | +alias kubectl kubecolor |
| 63 | +alias k kubectl |
| 64 | +EOF |
| 65 | + |
| 66 | +# Custom fish prompt |
| 67 | +tee /home/vscode/.config/fish/conf.d/fish_greeting.fish > /dev/null <<EOF |
| 68 | +set fish_greeting |
| 69 | +EOF |
| 70 | + |
| 71 | +# Add direnv whitelist for the workspace directory |
| 72 | +mkdir -p /home/vscode/.config/direnv |
| 73 | +tee /home/vscode/.config/direnv/direnv.toml > /dev/null <<EOF |
| 74 | +[whitelist] |
| 75 | +prefix = [ "/workspaces" ] |
| 76 | +EOF |
| 77 | + |
| 78 | +# Set ownership vscode .config directory to the vscode user |
| 79 | +chown -R vscode:vscode /home/vscode/.config |
0 commit comments