dotfiles/install/install.sh
Claude 096c3c8afa
feat(install): switch to Homebrew for the CLI toolchain
Ubuntu 24.04's apt versions of fzf/fd/bat/eza/zoxide/ripgrep/tmux/nvim/
lazygit/starship are frozen at April 2024 — and the previous GitHub-
release downloads went stale the moment you stopped re-running the
installer. Homebrew on Linux fixes both: always-latest releases and a
single 'brew upgrade' to update the whole CLI stack.

Two-tier install:
  apt   - zsh + base plumbing + WezTerm (vendor repo) + Brave Beta
          (vendor repo). Vendor repos auto-update via 'apt upgrade'.
  brew  - fzf fd bat eza zoxide ripgrep tmux neovim lazygit starship
          gh zsh-syntax-highlighting zsh-autosuggestions
  nvm   - official installer (pinned NVM_VERSION)
  tpm   - tmux plugin manager clone

New files:
  install/Brewfile - bundle for 'brew bundle'
  install/lib/brew.sh - Homebrew bootstrap + brew bundle
  install/lib/extras.sh - nvm + tpm
  install/install.sh - rewired entry point with --packages-only,
    --dotfiles-only, --help
  install/README.md - new docs for the two-tier strategy

.zshrc:
  - Source brew shellenv first when present, so brew bins win on PATH
  - 'update' alias now: brew upgrade && sudo apt update && sudo apt upgrade
    (previously apt-only; before that pacman-only)

Drops install/lib/packages.sh entries that the now-Brewfile-managed tools
duplicated, and removes the GitHub-release tarball install path.
2026-06-10 16:54:47 +00:00

79 lines
2.2 KiB
Bash
Executable file

#!/bin/bash
# Pop!_OS / Ubuntu installer for these dotfiles.
#
# What it does (idempotent — safe to re-run):
# 1. apt: system base (zsh, git, curl, build-essential, wl-clipboard).
# 2. Vendor apt repos: WezTerm, Brave Beta (GUI apps stay on apt).
# 3. Homebrew + Brewfile: fzf, fd, bat, eza, zoxide, ripgrep, tmux,
# neovim, lazygit, starship, gh, zsh plugins — always latest,
# updated later with a single `brew upgrade`.
# 4. nvm + tmux plugin manager (tpm).
# 5. Symlinks dotfiles into ~ and ~/.config.
# 6. Switches login shell to zsh.
#
# Usage:
# install/install.sh Full install
# install/install.sh --packages-only Only packages/tools (apt + brew)
# install/install.sh --dotfiles-only Only link dotfiles + tpm/nvm + chsh
# install/install.sh --help
set -eEo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/lib/common.sh"
source "$SCRIPT_DIR/lib/packages.sh"
source "$SCRIPT_DIR/lib/brew.sh"
source "$SCRIPT_DIR/lib/extras.sh"
source "$SCRIPT_DIR/lib/dotfiles.sh"
usage() {
sed -n '2,18p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
}
MODE=all
for arg in "$@"; do
case $arg in
--packages-only) MODE=packages ;;
--dotfiles-only) MODE=dotfiles ;;
-h|--help) usage; exit 0 ;;
*) die "Unknown argument: $arg (try --help)" ;;
esac
done
preflight() {
command -v apt-get >/dev/null 2>&1 || die "apt-get not found — this installer targets Debian/Ubuntu/Pop!_OS."
((EUID != 0)) || die "Do not run as root; run as your regular user."
require_cmd sudo
require_cmd curl
}
main() {
preflight
case $MODE in
packages)
install_all_packages
install_brew_packages
install_all_extras
;;
dotfiles)
link_dotfiles
install_tpm
install_nvm
set_zsh_as_shell
;;
all)
install_all_packages
install_brew_packages
install_all_extras
link_dotfiles
set_zsh_as_shell
;;
esac
info "Done. Open a new shell (or log out + back in) to pick up the new login shell."
info "First tmux launch: prefix + I to fetch tpm plugins."
info "Keep tools current with: brew upgrade && sudo apt upgrade"
}
main