Skip to content

johndotpub/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

133 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✨A brew-first and zsh-focused toolkit

Release CI Tests UNLICENSE
Shell Zsh Framework Oh My Zsh Prompt Starship Python Pyenv
Package Manager Homebrew SHA256 Verified Lint ShellCheck Platform Linux/macOS/WSL

Clean, straightforward dotfiles setup for Linux, macOS, and WSL:

Supported OS: Ubuntu, Ubuntu (WSL), and macOS. Focus: A Homebrew-first, zsh-focused dotfiles toolkit.

  • 🍺 Brew-first package install (all sections of packages/brew.yaml installed by default)
  • 🧾 Release verification (SHA256 + optional GPG on checksum)
  • 🧩 Default skel profile deployment
  • πŸŒƒ Starship Tokyo Night preset by default
  • πŸ“ Nano syntax highlighting via nanorc
  • 🧱 tmux via Homebrew + oh-my-tmux base config
  • πŸ§ͺ Dry-run support
  • πŸ”Ž Verbose debug mode when needed
  • ♻️ Safe re-runs (backup-and-replace by default; use --preserve to keep existing files)
  • πŸ”’ Single-run lock to prevent concurrent installer collisions
  • πŸ“‹ Optional machine-readable install report (--report-json)

πŸš€ Quick start (local)

chmod +x install.sh
# preview changes first
./install.sh --dry-run --verbose
# run install
./install.sh -y

By default, existing files like ~/.zshrc are backed up to .bak.<date> and replaced with fresh skel copies. If the deployed file already matches skel exactly, the backup and copy are skipped (idempotent reruns). Use --preserve to keep existing files unchanged without any backups.

🌐 Quick start (Pages bootstrap)

# Latest main branch β€” one-liner, no version required:
curl -fsSL https://dot.rly.wtf/bootstrap.sh | bash

# Pinned to a specific release (recommended for reproducible installs):
curl -fsSL https://dot.rly.wtf/bootstrap.sh | bash -s -- --ref v1.0.7

# Branch (unverified):
curl -fsSL https://dot.rly.wtf/bootstrap.sh | bash -s -- --ref my-branch

Note: The refless form downloads the current main branch directly. It skips checksum verification and may include unreleased changes. Use --ref with a release tag for a verified, reproducible install. Branches are also supported but skip checksum verification.

πŸ—‚οΈ Project layout

.
β”œβ”€β”€ bootstrap.sh
β”œβ”€β”€ install.sh
β”œβ”€β”€ inventory/
β”‚   └── default.yaml
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ brew.yaml
β”‚   └── apt.yaml
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ lib/brew-env.sh
β”‚   β”œβ”€β”€ lib/helpers.sh
β”‚   β”œβ”€β”€ lib/install-flags.sh
β”‚   β”œβ”€β”€ setup-starship.sh
β”‚   └── post-install-checks.sh
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ root-configs.sh
β”‚   β”œβ”€β”€ lib/test-shims.sh
β”‚   β”œβ”€β”€ backup-collision.sh
β”‚   β”œβ”€β”€ bootstrap-e2e.sh
β”‚   β”œβ”€β”€ brew-env.sh
β”‚   β”œβ”€β”€ brew-package-sections.sh
β”‚   β”œβ”€β”€ installer-lock.sh
β”‚   β”œβ”€β”€ installer-idempotency.sh
β”‚   β”œβ”€β”€ preserve-flag.sh
β”‚   β”œβ”€β”€ sudo-single-prompt.sh
β”‚   β”œβ”€β”€ tmux-oh-my.sh
β”‚   β”œβ”€β”€ report-json.sh
β”‚   β”œβ”€β”€ skel-merge.sh
β”‚   β”œβ”€β”€ ssh-config-migration.sh
β”‚   β”œβ”€β”€ nanorc-optional-failure.sh
β”‚   β”œβ”€β”€ release-reproducible.sh
β”‚   └── suite.bats
└── skel/
    └── default/
        β”œβ”€β”€ .zshrc
        β”œβ”€β”€ .zshenv
        β”œβ”€β”€ .tmux.conf.local
        β”œβ”€β”€ .gitconfig
        β”œβ”€β”€ .ssh/config
        └── .config/
            β”œβ”€β”€ brew-init.sh
            └── starship.toml

πŸ“£ Output style

  • Standard mode: concise stage updates + status emojis
  • --verbose: extra πŸ”Ž debug lines
  • --dry-run: commands are printed with πŸ§ͺ and not executed
  • Post-install checks use traffic lights (🟒 / 🟑 / πŸ”΄)

βš™οΈ Installer flags

  • --ref <ref> (release tag or branch; release tags get checksum verification)
  • --host <host> (advanced optional profile name; most users can ignore this)
  • --pyver <ver>
  • --create-home-pyver
  • --dry-run
  • --preserve (keep existing files untouched; opt out of backup-and-replace)
  • --brew-only
  • --no-apt
  • --verbose
  • --from-release (set internally by bootstrap)
  • --report-json <path> (writes a JSON phase summary)
  • --no-lock (advanced/debug; disables install lock guard)

πŸ” Security env knobs

  • BOOTSTRAP_GPG_FINGERPRINT to enforce expected checksum signer fingerprint in bootstrap.sh

πŸ“¦ Build a release artifact manually

TAG=v1.0.0
REPO_NAME="$(basename "$PWD")"
mkdir -p dist
tar --sort=name --mtime='UTC 1970-01-01' --owner=0 --group=0 --numeric-owner \
  --exclude='.git' --exclude='./dist' -cf - . | gzip -n > "dist/${REPO_NAME}-${TAG}.tar.gz"
(cd dist && sha256sum "${REPO_NAME}-${TAG}.tar.gz" > "${REPO_NAME}-${TAG}.tar.gz.sha256")

Verify deterministic archive output:

./test/release-reproducible.sh "$TAG"

On macOS, install GNU tar first for deterministic-archive verification: brew install gnu-tar

🧰 Package inventory workflow

packages/brew.yaml is the single source of truth for Homebrew packages. All sections (base, development, navigation, networking, system, media, security, inference, optional) are installed by default. Inference tools (ollama, llama.cpp, llmfit) are now plain brew packages and no longer require a separate opt-in flag.

packages/apt.yaml defines optional apt packages for Linux hosts. The apt_minimal section is installed when running without --brew-only or --no-apt.

πŸ€– Agentic standards

Repository AI guidance lives in AGENTS.md and includes:

  • DRY/minimal change expectations
  • Idempotency and safe-default requirements
  • Ample, purposeful section/function comments in shell scripts and tests

🧠 Migration notes

  • Existing files in $HOME are backed up to .bak.<date> and replaced with fresh skel copies by default. If the deployed file already matches skel exactly, the backup and copy are skipped. Use --preserve to keep existing files unchanged.
  • ~/.zshenv is deployed from skel/default/.zshenv via the same deploy_skel_profile path as .zshrc; it respects --preserve and idempotency in the same way.
  • Existing ~/.ssh/config is auto-migrated to ~/.ssh/config.local when local file is absent; managed ~/.ssh/config then includes ~/.ssh/config.local. If ~/.ssh/config.local already exists it is backed up before migration. --preserve skips the SSH migration entirely, leaving both files untouched.

βœ… CI tests

GitHub Actions runs a CI workflow that checks:

  • shell syntax (bash -n)
  • shellcheck linting
  • no duplicate repo-root shell config files
  • installer/bootstrap help output
  • installer idempotency behavior (backup-and-replace by default; no new backups when file matches skel)
  • backup collision handling for deterministic .bak.<date>[.<n>] naming
  • backup accumulation across 4 runs (2 mutations + 1 idempotent + 1 mutation β†’ 3 .bak.* files each)
  • skel directory merge behavior (preserve existing files, copy missing files)
  • SSH config include migration behavior (test/ssh-config-migration.sh)
  • oh-my-tmux bootstrap/preserve/override behavior (test/tmux-oh-my.sh)
  • installer lock contention behavior (test/installer-lock.sh)
  • report JSON validity/escaping checks (test/report-json.sh)
  • brew package sections behavior (test/brew-package-sections.sh)
  • sudo single-prompt behavior (test/sudo-single-prompt.sh)
  • optional nanorc clone failure handling (test/nanorc-optional-failure.sh)
  • brew environment resolution scenarios (test/brew-env.sh)
  • bootstrap end-to-end README curl flow (test/bootstrap-e2e.sh)
  • DRY BATS installer suite (test/suite.bats) running all integration checks
  • release reproducibility verification (test/release-reproducible.sh, tag workflow)

πŸ“ Changelog

Release notes live in CHANGELOG.md.

πŸ“œ License

Released under UNLICENSE. See UNLICENSE.

About

Brew-first, zsh-focused dotfiles toolkit with idempotent installs, verified bootstrap, and DRY CI-tested setup for Ubuntu/WSL/macOS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages