Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shell & Prompt

The shell configuration lives in home/common/shell.nix and provides a consistent experience across macOS and Linux.

Zsh

Zsh is the default shell with these plugins:

  • zsh-autosuggestions – fish-like history suggestions
  • zsh-syntax-highlighting – command syntax coloring

It also restores a few interactive behaviors that changed after the move to Home Manager-managed zsh:

  • Delete performs forward delete instead of inserting ~
  • Up and Down search history by the current typed prefix
  • Ctrl-W uses bash-style word boundaries
  • ~/.zshrc.local is sourced if present for machine-local shell experiments

Starship Prompt

The prompt uses Starship with an elaborate Ayu Mirage-themed configuration using Nerd Font “pill” segments:

┌  macOS  ~/workspace/personal/nix-config   main   nix   1.2s
└

Each segment is color-coded and separated by Nerd Font glyphs. The prompt shows:

SegmentWhat it displays
OS iconmacOS/Linux logo
DirectoryCurrent path (truncated to 3 levels)
Git branchBranch name + status
LanguagesNode, Python, Rust, Go, Java versions (when detected)
DurationCommand execution time (if > 2 seconds)
ShellCurrent shell name
TimeHH:MM format

Aliases

Global aliases defined in shell.nix:

AliasCommandNotes
ls, l, ll, laeza variantsWith icons and git status
cat, lessbatSyntax-highlighted pager
ocopencodeAI coding agent
gst, gd, ga, gcgit shortcutsCommon git operations
dockercontainermacOS only (Apple container runtime)
up Ncd ../../../...Navigate up N directories

Per-host aliases go in hosts/<arch>-darwin/<hostname>/home.nix or systems/<arch>-linux/<hostname>/home.nix – see Per-Host Overrides.

CLI Helpers

Repo-managed helper scripts installed from files/scripts/:

ScriptPurpose
rundRun a disposable Ubuntu container with the current directory mounted in

Packaged Git workflow tools installed via Home Manager:

ToolPurpose
wtWorktrunk worktree management with shell integration
git trimTrim tracking branches merged or gone upstream
git townHigher-level branch workflow and sync helpers

Git worktree management is now provided by Worktrunk via the wt command and its shell integration configured in home/common/default.nix.

Platform-Aware Behavior

  • macOS adds /opt/homebrew/bin and /opt/homebrew/sbin to $PATH
  • The docker alias only applies on Darwin (maps to Apple’s container runtime)
  • Esc Esc toggles a leading sudo like the oh-my-zsh sudo plugin
  • mise activate zsh is loaded when mise is available
  • Ghostty shell integration is sourced manually (workaround for cmux)