From 4a771aa5a09b0620e70358ba81108e64f2b82303 Mon Sep 17 00:00:00 2001 From: Carson Seese Date: Fri, 28 Aug 2026 15:03:41 -0400 Subject: [PATCH 01/21] Detect Omarchy and reorganize shell config around drop-in directories Adds the two data flags the rest of the Omarchy work hangs off, and restructures the shell configuration so that files another owner also writes to never have to be contested. Detection: - isOmarchy reads ID=omarchy from /etc/os-release. Keying on the distro ID rather than on a path makes it false by construction in WSL (ID=arch/ubuntu), dev containers, macOS and Windows, so no Omarchy-only file can leak onto another host. - isThinkPad reads /sys/class/dmi/id/product_family, so the hardware pieces landing in later commits gate on the machine rather than on the distro. Drop-in directories: - ~/.bashrc and ~/.zshrc become four-line loaders over ~/.config/sh/rc.d/*.sh and should not need to change again. The content they held is now one numbered file per concern, with 00-shell.sh setting DOTFILES_SHELL so the rest can hand the right name to `starship init`, `mise activate` and friends. That granularity is what lets a single .chezmoiignore line drop exactly the pieces a host already provides -- on Omarchy, starship/mise/zoxide/history, all four of which its own default/bash/rc already sets up. - On Omarchy the loader sits below Omarchy's own /etc/skel/.bashrc preamble, kept byte-for-byte: env-bootstrap has to run above the interactivity guard or `bash -lc`, SSH commands and omarchy-launch-floating-terminal (a `bash -c`) lose OMARCHY_PATH and the mise/~/.local/bin PATH entries. - The mise tool pins move from ~/.config/mise/config.toml to conf.d/10-dotfiles.toml. Omarchy provisions 13 lazy tool wrappers via `omarchy mise install`, and each runs `mise use -g` on every invocation, which rewrites config.toml; mise structurally refuses to write into conf.d, so chezmoi and Omarchy stop clobbering each other. Because config.toml outranks conf.d, the Omarchy branch drops the tools Omarchy already ships rather than pinning versions that would be silently ignored -- herdr especially, where Omarchy has a migration deleting mise copies because a stale client shadows /usr/bin/herdr with an older wire protocol. A run_once script moves a pre-existing dotfiles-owned config.toml aside, recognising it by its minimum_release_age line so a `mise use -g` config survives untouched. Also on Omarchy: ~/.config/git/config is removed (git reads it before ~/.gitconfig, so its personal user.email and defaultBranch=master leak through on every key the dotfiles leave unset, and Omarchy writes it only on first run); ~/.config/ghostty/config is left unmanaged, since it is byte-identical to Omarchy's default and leaving it alone keeps `omarchy font set` and the theme system drift-free; and settings.json points Claude Code at the theme omarchy-theme-set regenerates on every theme change. Verified with render.sh: the non-Omarchy mise render resolves to the same 28 tools as before, settings.json is byte-identical off Omarchy, and the rendered Omarchy .bashrc sources cleanly under `bash -i` in a throwaway HOME (OMARCHY_PATH set, drop-ins layered above Omarchy's rc). --- AGENTS.md | 54 +++++++++++- root/.chezmoi.toml.tmpl | 19 +++++ root/.chezmoiignore.tmpl | 27 ++++++ root/.chezmoiremove.tmpl | 8 ++ ...nce_before_00-migrate-mise-config.ps1.tmpl | 16 ++++ ...once_before_00-migrate-mise-config.sh.tmpl | 24 ++++++ root/.chezmoitemplates/shell-rcd | 9 ++ root/dot_bashrc.tmpl | 61 ++++---------- root/dot_claude/settings.json.tmpl | 7 ++ root/dot_zshrc.tmpl | 58 ++----------- .../mise/conf.d/10-dotfiles.toml.tmpl | 84 +++++++++++++++++++ root/private_dot_config/mise/config.toml.tmpl | 60 ------------- root/private_dot_config/sh/rc.d/00-shell.sh | 10 +++ .../sh/rc.d/05-brew.sh.tmpl | 10 +++ .../sh/rc.d/10-path.sh.tmpl | 1 + .../private_dot_config/sh/rc.d/20-env.sh.tmpl | 1 + .../sh/rc.d/30-completions.sh | 4 + .../private_dot_config/sh/rc.d/40-starship.sh | 3 + root/private_dot_config/sh/rc.d/41-mise.sh | 3 + root/private_dot_config/sh/rc.d/42-zoxide.sh | 3 + root/private_dot_config/sh/rc.d/43-mcfly.sh | 3 + root/private_dot_config/sh/rc.d/50-vscode.sh | 3 + root/private_dot_config/sh/rc.d/60-fzkill.sh | 3 + root/private_dot_config/sh/rc.d/70-history.sh | 18 ++++ 24 files changed, 332 insertions(+), 157 deletions(-) create mode 100644 root/.chezmoiscripts/run_once_before_00-migrate-mise-config.ps1.tmpl create mode 100644 root/.chezmoiscripts/run_once_before_00-migrate-mise-config.sh.tmpl create mode 100644 root/.chezmoitemplates/shell-rcd create mode 100644 root/private_dot_config/mise/conf.d/10-dotfiles.toml.tmpl delete mode 100644 root/private_dot_config/mise/config.toml.tmpl create mode 100644 root/private_dot_config/sh/rc.d/00-shell.sh create mode 100644 root/private_dot_config/sh/rc.d/05-brew.sh.tmpl create mode 100644 root/private_dot_config/sh/rc.d/10-path.sh.tmpl create mode 100644 root/private_dot_config/sh/rc.d/20-env.sh.tmpl create mode 100644 root/private_dot_config/sh/rc.d/30-completions.sh create mode 100644 root/private_dot_config/sh/rc.d/40-starship.sh create mode 100644 root/private_dot_config/sh/rc.d/41-mise.sh create mode 100644 root/private_dot_config/sh/rc.d/42-zoxide.sh create mode 100644 root/private_dot_config/sh/rc.d/43-mcfly.sh create mode 100644 root/private_dot_config/sh/rc.d/50-vscode.sh create mode 100644 root/private_dot_config/sh/rc.d/60-fzkill.sh create mode 100644 root/private_dot_config/sh/rc.d/70-history.sh diff --git a/AGENTS.md b/AGENTS.md index eeac50b..8816899 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,6 +42,17 @@ The dotfiles adapt based on environment variables: - `DOTFILES_WORK_EMAIL` - Work email fallback when `~/work.email` is absent (the file wins; Codespaces user secrets surface as env vars) - `DOTFILES_WORK_EMAIL_FILE` - Relocates the work-email file from `~/work.email` (used by render.sh; unset in normal use) +Two data flags are derived from the machine itself rather than from env vars: + +- **`isOmarchy`** - true when `/etc/os-release` has `ID=omarchy`. [Omarchy](https://omarchy.org) is an opinionated Arch/Hyprland distribution that owns a large part of `$HOME`. Because the check is on the distro ID, it is false by construction in WSL (`ID=arch`/`ubuntu`), dev containers, macOS and Windows, so no Omarchy-only file can leak onto another host. Preview an Omarchy render from anywhere with `./render.sh --data '{"isOmarchy":true}'