feat: auto-detect and install missing shell frameworks after restore

After mackup restores dotfiles, ~/.zshrc may reference tools (Oh My Zsh,
nvm, pyenv, rustup, …) that haven't been installed yet, causing errors on
first shell login.

lib/shell.sh:
  - Defines 13 built-in frameworks with detect + install commands
  - Scans ~/.zshrc / ~/.bashrc etc. for references before installing
    (avoids installing things the user doesn't actually use)
  - SSR_SHELL_DEPS_EXTRA in ssr.conf for custom user additions

bin/ssr-restore:
  - Adds `shell_deps` as a resumable step after mackup_restore
  - Sources ~/.config/ssr/post-restore.sh if present (user hook)

config/post-restore.sh.example:
  - Template with commented examples (OMZ plugins, npm globals, SSH keys)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-12 10:19:32 +02:00
parent 649449c628
commit 371dea1851
4 changed files with 297 additions and 0 deletions
+16
View File
@@ -73,6 +73,22 @@ SSR_PREFS_CONFLICT_DEFAULT=accept
# Set to "true" to skip all conflict prompts and auto-accept everywhere.
# SSR_ASSUME_YES=false
# ---------------------------------------------------------------------------
# Shell framework auto-install (runs after mackup restore)
# ---------------------------------------------------------------------------
# Detect shell frameworks referenced in dotfiles that are not yet installed
# (e.g. oh-my-zsh, nvm, pyenv, rustup, starship, …) and install them.
# Set to "false" to skip this step.
# SSR_SHELL_DEPS_ENABLED=true
# Additional custom deps, space-separated, pipe-delimited format:
# "name|check_expression|install_command"
# Example:
# SSR_SHELL_DEPS_EXTRA=(
# "my-tool|command -v my-tool|brew install my-tool"
# "my-fw|[[ -d ~/.my-fw ]]|curl -sSL https://example.com/install.sh | bash"
# )
# ---------------------------------------------------------------------------
# macOS restore behavior
# ---------------------------------------------------------------------------