-
Notifications
You must be signed in to change notification settings - Fork 0
Consuming Core in an OS Repo
This page covers the mechanics of pulling Core into a machine repo and keeping it up to date. For the why (subtree vs. submodule, the layer model), see Architecture & the Three-Layer Model.
Inside the OS repo (for example dotfiles-Fedora), add Core as a squashed
subtree under core/:
git subtree add --prefix=core https://github.com/<you>/dotfiles-core main --squashThis physically copies Core's files into core/ and commits them. The repo now
clones and works with no submodule flags β clone-and-go, which matters for
public showcase repos.
The OS repo's bootstrap.sh symlinks the vendored Core files into place
alongside its own OS-native files:
-
core/zsh/*.zshβ sourced by the OS repo's.zshrcloader -
core/tmux/β~/.config/tmux/ -
core/nvim/β~/.config/nvim/ -
core/git/β git config (layered via[include]) -
core/starship/starship.tomlβ~/.config/starship.toml -
core/mise/config.tomlβ mise global config -
core/bin/βclip/clip-pasteinto~/.local/bin
Note: core/scripts/ (the dev tooling) is not symlinked β those run in the
Core repo only.
The OS repo's .zshrc sources the Core modules in the canonical order, then its
own native and local layers:
tools β ui β options β history β aliases β git β functions β fzf β
bindings β plugins β op β maint β update β os β local
os is the OS repo's native layer (package manager, clipboard, paths); local
is your untracked machine-specific overrides. (dotfiles-Kali inserts an
offensive stage: β¦ os offensive local.) See
The Zsh Module System for why the order is load-bearing.
After you change Core here and push, fan the update into every OS repo's core/
subtree with the maintain button:
./scripts/sync-core.sh # pull into every repo found
./scripts/sync-core.sh --dry-run # show what would happen, touch nothing
./scripts/sync-core.sh dotfiles-Fedora # only specific reposIt assumes all OS repos are cloned as siblings under one parent dir
(override with REPOS_ROOT).
sync-core.sh is the single point where Core is vendored into all nine repos, so
a defect here amplifies N-way. It therefore protects the fan-out:
- it runs the audit first and refuses to fan out a red tree
(
SYNC_SKIP_AUDIT=1is the documented escape hatch;--dry-runis exempt), - it warns when local HEAD differs from the remote tip that actually fans out (subtree pull fetches the remote tip, not your working tree), and
- it skips any OS repo with a dirty tree (subtree merges into a clean state only).
It prints both the SemVer (core.version) and the commit SHA that landed, so a
sync is traceable. Push each updated OS repo when you're satisfied.
| Variable | Purpose |
|---|---|
REPOS_ROOT |
parent dir holding the OS repos (default: parent of Core) |
CORE_REMOTE |
remote name/URL the OS repos pull Core from |
CORE_BRANCH |
the Core branch to vendor (default main) |
SYNC_SKIP_AUDIT |
1 to skip the pre-fan-out audit (escape hatch) |
From inside any OS repo, core-version reports the vendored Core's SemVer (read
from core.version), and core-doctor reports which tools that box detected. The
subtree squash commit records the exact Core commit that landed.
- Architecture & the Three-Layer Model
- Porting to a New Distro β stamping a brand-new OS repo.
- The Audit (Quality Gate) β what "audit-green" means.
dotfiles-core β the Core layer of
a nine-repo dotfiles system Β· authored once, vendored everywhere via git subtree.
Home Β· Architecture Β· Zsh Β· Tools Β· Neovim Β· tmux Β· FAQ
Source for these pages lives in
wiki/ β edit there and
sync. Β· core-help in any shell for the live cheat sheet.
Concepts
Reference
Operating it
Project
Repo links