docs(setup): add Debian 13 dev-VM setup procedure + scripts + devcontainer
CI / commits (pull_request) Successful in 2m52s
CI / check (pull_request) Successful in 3m3s
CI / scan (pull_request) Successful in 3m11s
CI / a11y (pull_request) Successful in 3m5s
Docs site / build (pull_request) Successful in 3m10s
CI / perf (pull_request) Successful in 6m53s
CI / commits (pull_request) Successful in 2m52s
CI / check (pull_request) Successful in 3m3s
CI / scan (pull_request) Successful in 3m11s
CI / a11y (pull_request) Successful in 3m5s
Docs site / build (pull_request) Successful in 3m10s
CI / perf (pull_request) Successful in 6m53s
New procedure in docs/setup/01-dev-debian-vm-setup.md targeting the new dev VM (10.100.201.21, Debian 13) that replaces the WSL workflow. The existing setup files are renumbered (01->02, 02->03, 03->04) to free prefix 01 for the default flow. 10 modular idempotent scripts under docs/setup/scripts/ install the stack: zsh + Oh My Zsh + Powerlevel10k + plugins, modern CLI tooling (bat, eza, fd-find, ripgrep, fzf, zoxide, ncdu, keychain + dev extras), nvm + Node from .nvmrc + corepack + pnpm, Docker CE + compose plugin, inotify watches + swap + hostname tuning, best-effort UFW + sshd hardening that probes-before-applying, and notes/aliases.zsh + notes/gitconfig.txt installation. A systemd template (apf-portal-infra@.service) auto-starts the local dev infra stack at boot per user. .devcontainer/ ships a VSCode Dev Container spec pinning Node 24 and attaching to the host's apf-portal-dev Compose network so postgres / redis / otel resolve by DNS from inside the container. initializeCommand fails fast if the infra hasn't been brought up yet. CLAUDE.md Environment conventions documents the two envs (local + development) plus the hybrid sub-mode (workstation IDE + VM infra via SSH LocalForward) and the two IDE flows (Remote-SSH + Devcontainer). Adjacent follow-ups (not in this PR): preview infra on the GitLab VM (10.100.201.10), GitLab Runner migration alongside the Gitea -> GitLab cutover, private dotfiles repo.
This commit is contained in:
Executable
+93
@@ -0,0 +1,93 @@
|
||||
#!/usr/bin/env bash
|
||||
# zsh + Oh My Zsh + Powerlevel10k + plugins (autosuggestions, syntax-highlighting).
|
||||
# Patches ~/.zshrc to set the theme, plugin list, fzf hook.
|
||||
set -euo pipefail
|
||||
# shellcheck source=./lib.sh
|
||||
source "$(cd "$(dirname "$0")" && pwd)/lib.sh"
|
||||
require_debian
|
||||
require_not_root
|
||||
|
||||
apt_install zsh
|
||||
|
||||
# Make zsh the default shell for $USER (idempotent).
|
||||
current_shell="$(getent passwd "$USER" | cut -d: -f7)"
|
||||
zsh_path="$(command -v zsh)"
|
||||
if [[ "$current_shell" != "$zsh_path" ]]; then
|
||||
log "Setting zsh as default shell for $USER (sudo will prompt)."
|
||||
sudo chsh -s "$zsh_path" "$USER"
|
||||
ok "Default shell set to $zsh_path. Takes effect on next login."
|
||||
else
|
||||
skip "zsh already default shell."
|
||||
fi
|
||||
|
||||
# Oh My Zsh — install with RUNZSH=no to avoid spawning zsh during the script.
|
||||
OMZ_DIR="$HOME/.oh-my-zsh"
|
||||
if [[ -d "$OMZ_DIR" ]]; then
|
||||
skip "Oh My Zsh already installed."
|
||||
else
|
||||
log "Installing Oh My Zsh."
|
||||
RUNZSH=no CHSH=no KEEP_ZSHRC=yes sh -c \
|
||||
"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
ok "Oh My Zsh installed."
|
||||
fi
|
||||
|
||||
ZSH_CUSTOM_DIR="${ZSH_CUSTOM:-$OMZ_DIR/custom}"
|
||||
|
||||
clone_or_skip() {
|
||||
local name="$1" url="$2" dir="$3"
|
||||
if [[ -d "$dir" ]]; then
|
||||
skip "$name already cloned at $dir."
|
||||
else
|
||||
log "Cloning $name."
|
||||
git clone --depth=1 "$url" "$dir"
|
||||
ok "$name installed."
|
||||
fi
|
||||
}
|
||||
|
||||
# Powerlevel10k theme.
|
||||
clone_or_skip "Powerlevel10k" \
|
||||
"https://github.com/romkatv/powerlevel10k.git" \
|
||||
"$ZSH_CUSTOM_DIR/themes/powerlevel10k"
|
||||
|
||||
# Plugins.
|
||||
clone_or_skip "zsh-autosuggestions" \
|
||||
"https://github.com/zsh-users/zsh-autosuggestions.git" \
|
||||
"$ZSH_CUSTOM_DIR/plugins/zsh-autosuggestions"
|
||||
|
||||
clone_or_skip "zsh-syntax-highlighting" \
|
||||
"https://github.com/zsh-users/zsh-syntax-highlighting.git" \
|
||||
"$ZSH_CUSTOM_DIR/plugins/zsh-syntax-highlighting"
|
||||
|
||||
# Patch ~/.zshrc — theme + plugin list + fzf hook.
|
||||
ZSHRC="$HOME/.zshrc"
|
||||
[[ -f "$ZSHRC" ]] || touch "$ZSHRC"
|
||||
|
||||
if grep -q '^ZSH_THEME=' "$ZSHRC"; then
|
||||
if grep -q '^ZSH_THEME="powerlevel10k/powerlevel10k"' "$ZSHRC"; then
|
||||
skip "ZSH_THEME already powerlevel10k."
|
||||
else
|
||||
sed -i 's#^ZSH_THEME=.*#ZSH_THEME="powerlevel10k/powerlevel10k"#' "$ZSHRC"
|
||||
ok "ZSH_THEME → powerlevel10k/powerlevel10k."
|
||||
fi
|
||||
else
|
||||
echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> "$ZSHRC"
|
||||
ok 'Set ZSH_THEME=powerlevel10k/powerlevel10k.'
|
||||
fi
|
||||
|
||||
PLUGINS_LINE='plugins=(git fzf zoxide direnv zsh-autosuggestions zsh-syntax-highlighting)'
|
||||
if grep -q '^plugins=' "$ZSHRC"; then
|
||||
if grep -q "^$PLUGINS_LINE" "$ZSHRC"; then
|
||||
skip "plugins=(...) already configured."
|
||||
else
|
||||
sed -i "s#^plugins=.*#$PLUGINS_LINE#" "$ZSHRC"
|
||||
ok "plugins=(...) updated."
|
||||
fi
|
||||
else
|
||||
echo "$PLUGINS_LINE" >> "$ZSHRC"
|
||||
ok "plugins=(...) added."
|
||||
fi
|
||||
|
||||
ensure_line '[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh' "$ZSHRC"
|
||||
|
||||
ok "zsh + Oh My Zsh + Powerlevel10k ready."
|
||||
log "Next: run 'exec zsh -l' then 'p10k configure' to pick a Powerlevel10k preset."
|
||||
Reference in New Issue
Block a user