From 6eef4f8077951c5f25e01338a00ee09edfa93add Mon Sep 17 00:00:00 2001 From: fkrebs Date: Wed, 20 May 2026 21:55:29 +0200 Subject: [PATCH] oh-my-zsh rework + LiteLLM model presets --- README.md | 20 ++++++++++++++++++++ home/.config/models.env | 9 +++++++++ home/.gitconfig | 19 +++++++++++++++++++ home/.zshrc | 34 ++++++++++++++++++++++++++++++++++ install.sh | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 120 insertions(+) create mode 100644 README.md create mode 100644 home/.config/models.env create mode 100644 home/.gitconfig create mode 100644 home/.zshrc create mode 100755 install.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce0f7b5 --- /dev/null +++ b/README.md @@ -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 diff --git a/home/.config/models.env b/home/.config/models.env new file mode 100644 index 0000000..7100acf --- /dev/null +++ b/home/.config/models.env @@ -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' diff --git a/home/.gitconfig b/home/.gitconfig new file mode 100644 index 0000000..7665166 --- /dev/null +++ b/home/.gitconfig @@ -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 diff --git a/home/.zshrc b/home/.zshrc new file mode 100644 index 0000000..7aa07d1 --- /dev/null +++ b/home/.zshrc @@ -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 ' && return 1 + mkdir -p "$HOME/work/$name" && cd "$HOME/work/$name" && uv init +} diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..cda963f --- /dev/null +++ b/install.sh @@ -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"