How the installer works
The entrypoint, the deploy script, and the guarantees that make every run safe to repeat.
On this page
The installer has two parts: an entrypoint that fetches and verifies a commit,
and a deploy script from that same commit that changes $HOME.
Flow
Entrypoint
.config/dotfiles/bootstrap.sh:
- Fetches the repository with Git and resolves the commit to install.
Nothing in
$HOMEchanges if this step fails. - Saves the mise installer to a temporary file, then runs it; a failed download aborts only the mise step. curl is restricted to HTTPS with TLS 1.2 or later; wget uses its default protocol settings. Without curl or wget, or if the install fails, it warns and continues.
- Runs the deploy script from the fetched commit; it never downloads the deploy script separately.
- Verifies that
~/.local/share/dotfilesis at the resolved commit.
The script body runs inside one function, so curl | sh never executes a partial download.
Deploy script
.config/dotfiles/mise-tasks/bootstrap.sh:
- Clones the bare repository to
~/.local/share/dotfilesand sets its fetch refspec, soorigin/<branch>updates. - Checks out tracked files into
$HOMEon the first run; later runs fast-forward. The first checkout is keyed on~/.local/share/dotfiles/index, so it resumes interrupted installs and adopts a manually cloned bare repository. - Keeps
core.bare=true, removes a legacycore.worktree, and passes--work-tree="$HOME"explicitly. - Initializes the selected submodules from
$HOME. - Links the bare repository's
info/excludeto the tracked.config/dotfiles/gitignore. - Installs Git hooks through mise when available, or directly when
prekis onPATH.
Design choices
- One commit, one source.
The deploy script and the files it deploys come from the same commit.
A full commit ID in
DOTFILES_REFmakes Git verify every fetched object. - Verify before changing.
The commit resolves in a temporary directory before
$HOMEchanges. - mise is optional. A missing downloader or a failed mise install warns and continues. The mise installer is outside commit verification; see Security model.
- Fast-forward only.
Updates never create merge commits in
$HOME; diverged history stops the update. - Private backups.
Replaced files can hold credentials, so
~/.df-bakis created with mode700. - Tool detection.
Plugin groups initialize only when their tool is on
PATH; the documentation theme is opt-in because only a site build needs it. - Idempotent. Every step checks its state first; rerun the installer at any time.