oh-my-zsh rework + LiteLLM model presets
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
# dotfiles
|
||||||
|
|
||||||
|
Personal dotfiles for Coder workspaces. Coder clones this repo and runs install.sh
|
||||||
|
on workspace start (configured via the workspace template parameter dotfiles_uri).
|
||||||
|
|
||||||
|
## What gets installed
|
||||||
|
- zsh (if missing) + oh-my-zsh + zsh-autosuggestions + zsh-syntax-highlighting
|
||||||
|
- agnoster theme, plugins: git docker python pip uv vscode command-not-found
|
||||||
|
- ~/.zshrc, ~/.gitconfig, ~/.config/models.env (sourced by zshrc)
|
||||||
|
- Default shell flipped to zsh
|
||||||
|
|
||||||
|
## Model presets
|
||||||
|
The workspace template bakes the LiteLLM connection (OPENAI_API_KEY +
|
||||||
|
OPENAI_BASE_URL pointing at LAN LiteLLM). models.env adds a tiered picker:
|
||||||
|
`MODEL_CODE`, `MODEL_BIG_CODE`, `MODEL_GENERAL`, `MODEL_FAST`,
|
||||||
|
`MODEL_REASON`, `MODEL_PRO`, `MODEL_EMBED`.
|
||||||
|
|
||||||
|
## Layout
|
||||||
|
- install.sh — idempotent installer, runs on every workspace start
|
||||||
|
- home/ — contents mirrored into $HOME
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# LiteLLM model presets. Sourced by .zshrc; overridable per-shell.
|
||||||
|
# (Connection envs are baked into the workspace template; these are the picker.)
|
||||||
|
export MODEL_CODE='qwen3-coder-30b-a3b-instruct'
|
||||||
|
export MODEL_BIG_CODE='devstral-2-123b-instruct-2512'
|
||||||
|
export MODEL_GENERAL='qwen3.5-397b-a17b'
|
||||||
|
export MODEL_FAST='mistral-small-latest'
|
||||||
|
export MODEL_REASON='deepseek-r1-distill-llama-70b'
|
||||||
|
export MODEL_PRO='gemini-2.5-pro'
|
||||||
|
export MODEL_EMBED='text-embedding-3-large'
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[user]
|
||||||
|
name = fkrebs
|
||||||
|
email = fkrebs@nucli.de
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
[pull]
|
||||||
|
rebase = true
|
||||||
|
[push]
|
||||||
|
default = simple
|
||||||
|
autoSetupRemote = true
|
||||||
|
[core]
|
||||||
|
editor = nano
|
||||||
|
[diff]
|
||||||
|
algorithm = histogram
|
||||||
|
[alias]
|
||||||
|
s = status -sb
|
||||||
|
co = checkout
|
||||||
|
br = branch
|
||||||
|
lg = log --oneline --graph --decorate -20
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
# Oh My Zsh
|
||||||
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
ZSH_THEME="agnoster"
|
||||||
|
plugins=(git docker python pip uv vscode command-not-found zsh-autosuggestions zsh-syntax-highlighting)
|
||||||
|
source "$ZSH/oh-my-zsh.sh"
|
||||||
|
|
||||||
|
# User PATH
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
export EDITOR="${EDITOR:-nano}"
|
||||||
|
export MPLBACKEND="${MPLBACKEND:-Agg}"
|
||||||
|
|
||||||
|
# Source LiteLLM model presets if dotfiles delivered them
|
||||||
|
[ -f "$HOME/.config/models.env" ] && source "$HOME/.config/models.env"
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
alias ll='ls -lah --color=auto'
|
||||||
|
alias g='git'
|
||||||
|
alias gs='git status -sb'
|
||||||
|
alias gd='git diff'
|
||||||
|
alias gco='git checkout'
|
||||||
|
alias uvr='uv run'
|
||||||
|
alias uvs='uv sync'
|
||||||
|
|
||||||
|
# Model-switch aliases for aider (override per-call)
|
||||||
|
alias aider-code='AIDER_MODEL=$MODEL_CODE aider'
|
||||||
|
alias aider-big='AIDER_MODEL=$MODEL_BIG_CODE aider'
|
||||||
|
alias aider-reason='AIDER_MODEL=$MODEL_REASON aider'
|
||||||
|
alias aider-fast='AIDER_MODEL=$MODEL_FAST aider'
|
||||||
|
|
||||||
|
mkproj() {
|
||||||
|
local name="$1"
|
||||||
|
[ -z "$name" ] && echo 'usage: mkproj <name>' && return 1
|
||||||
|
mkdir -p "$HOME/work/$name" && cd "$HOME/work/$name" && uv init
|
||||||
|
}
|
||||||
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Idempotent install: ensure zsh + oh-my-zsh, then symlink configs.
|
||||||
|
set -euo pipefail
|
||||||
|
SRC=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
|
||||||
|
# 1. zsh (workspace base image may or may not have it)
|
||||||
|
if ! command -v zsh >/dev/null 2>&1; then
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y --no-install-recommends zsh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. oh-my-zsh
|
||||||
|
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||||
|
RUNZSH=no CHSH=no KEEP_ZSHRC=yes \
|
||||||
|
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. zsh plugins (autosuggestions + syntax highlighting)
|
||||||
|
ZSH_CUSTOM=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
|
||||||
|
[ -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ] || \
|
||||||
|
git clone -q https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
||||||
|
[ -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ] || \
|
||||||
|
git clone -q https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
|
||||||
|
|
||||||
|
# 4. symlink every file under home/ into $HOME (idempotent)
|
||||||
|
while IFS= read -r f; do
|
||||||
|
rel=${f#"$SRC/home/"}
|
||||||
|
mkdir -p "$HOME/$(dirname "$rel")"
|
||||||
|
ln -sf "$SRC/home/$rel" "$HOME/$rel"
|
||||||
|
done < <(find "$SRC/home" -mindepth 1 -type f)
|
||||||
|
|
||||||
|
# 5. default shell -> zsh
|
||||||
|
CURSHELL=$(getent passwd "$USER" | cut -d: -f7)
|
||||||
|
if [ "$CURSHELL" != "$(command -v zsh)" ]; then
|
||||||
|
sudo chsh -s "$(command -v zsh)" "$USER" || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "dotfiles installed: zsh + ohmyzsh + symlinks from $SRC/home"
|
||||||
Reference in New Issue
Block a user