From 0da30096ee14d39e5ef258d2d49cd0689543950b Mon Sep 17 00:00:00 2001 From: joelazar Date: Tue, 14 Jul 2026 23:25:06 +0200 Subject: [PATCH] :truck: move chezmoi setup scripts to .chezmoiscripts directory - Move `run_once_install_packages.sh.tmpl`, `run_once_settings.sh.tmpl`, `run_onchange_install-sandbox-deps.sh.tmpl`, `run_onchange_set-default-apps.sh.tmpl` to `.chezmoiscripts/` - Update README and AGENTS.md links to reflect new script paths - Reorganize AGENTS.md with clearer structure and instructions --- .../run_once_install_packages.sh.tmpl | 0 .../run_once_settings.sh.tmpl | 0 .../run_onchange_install-sandbox-deps.sh.tmpl | 0 .../run_onchange_set-default-apps.sh.tmpl | 0 AGENTS.md | 37 +++++++++++++++---- README.md | 6 +-- 6 files changed, 32 insertions(+), 11 deletions(-) rename run_once_install_packages.sh.tmpl => .chezmoiscripts/run_once_install_packages.sh.tmpl (100%) rename run_once_settings.sh.tmpl => .chezmoiscripts/run_once_settings.sh.tmpl (100%) rename run_onchange_install-sandbox-deps.sh.tmpl => .chezmoiscripts/run_onchange_install-sandbox-deps.sh.tmpl (100%) rename run_onchange_set-default-apps.sh.tmpl => .chezmoiscripts/run_onchange_set-default-apps.sh.tmpl (100%) diff --git a/run_once_install_packages.sh.tmpl b/.chezmoiscripts/run_once_install_packages.sh.tmpl similarity index 100% rename from run_once_install_packages.sh.tmpl rename to .chezmoiscripts/run_once_install_packages.sh.tmpl diff --git a/run_once_settings.sh.tmpl b/.chezmoiscripts/run_once_settings.sh.tmpl similarity index 100% rename from run_once_settings.sh.tmpl rename to .chezmoiscripts/run_once_settings.sh.tmpl diff --git a/run_onchange_install-sandbox-deps.sh.tmpl b/.chezmoiscripts/run_onchange_install-sandbox-deps.sh.tmpl similarity index 100% rename from run_onchange_install-sandbox-deps.sh.tmpl rename to .chezmoiscripts/run_onchange_install-sandbox-deps.sh.tmpl diff --git a/run_onchange_set-default-apps.sh.tmpl b/.chezmoiscripts/run_onchange_set-default-apps.sh.tmpl similarity index 100% rename from run_onchange_set-default-apps.sh.tmpl rename to .chezmoiscripts/run_onchange_set-default-apps.sh.tmpl diff --git a/AGENTS.md b/AGENTS.md index e3da4354..1fb95d93 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,8 +1,29 @@ -- **Key directories**: `dot_config/` (app configs), `private_dot_local/bin/` (custom scripts), `scripts/` (utilities) -- **File naming**: `dot_*` → dotfiles, `private_*` → sensitive data, `run_once_*` → setup scripts, `.tmpl` → templates -- **Templates**: Use Go text/template with variables like `{{ .email }}`, `{{ .name }}`, `{{ .chezmoi.sourceDir }}` -- **Always run `chezmoi apply` after making changes** to deploy them to the actual dotfile locations. Without this step, edits in the chezmoi source directory have no effect on the live system. -- **Shell**: Bash with error handling, use `scripts/utils` patterns, descriptive function names - - Use `gum` for interactive prompts, spinners, styled output, and confirmations (with plain fallbacks when gum is unavailable) - - Source `scripts/utils` for consistent color/style helper functions - - Validate scripts with `bash -n` and `shellcheck` before finishing +# Instructions + +## Common operations + +```bash +chezmoi diff # preview changes +chezmoi apply # apply individual files, never all at once +``` + +Always apply changed targets after editing, edits in this source directory have no effect on the live system until applied. + +## Structure + +This repo root is the chezmoi source directory. + +- `dot_*` → `~/.*`, `private_*` → sensitive files, `.tmpl` → Go text/template (variables: `{{ .email }}`, `{{ .name }}`, `{{ .type }}`, `{{ .chezmoi.sourceDir }}`) +- `.chezmoiscripts/` — `run_once_*`/`run_onchange_*` setup scripts +- `scripts/` — shared shell utilities, not deployed +- `Brewfile.{work,private,workstation}` — packages per machine type (`type` is prompted on `chezmoi init`) + +## Shell scripts + +- Bash with error handling and descriptive function names +- Source `scripts/utils` for color/style helpers; use `gum` for prompts and spinners, with plain fallbacks +- Validate with `bash -n` and `shellcheck` before finishing + +## CI + +`.github/workflows/chezmoi.yml` applies and verifies all three machine types and lints scripts. diff --git a/README.md b/README.md index e7471c5a..8bf4297d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ A few quick facts: - **Dotfile manager:** [chezmoi](https://www.chezmoi.io/) - **Profiles:** `private`, `work`, and `workstation` - **Bootstrap path:** [`bootstrap.sh`](bootstrap.sh) -- **First-run automation:** [`run_once_install_packages.sh.tmpl`](run_once_install_packages.sh.tmpl) and [`run_once_settings.sh.tmpl`](run_once_settings.sh.tmpl) +- **First-run automation:** [`run_once_install_packages.sh.tmpl`](.chezmoiscripts/run_once_install_packages.sh.tmpl) and [`run_once_settings.sh.tmpl`](.chezmoiscripts/run_once_settings.sh.tmpl) - **Theme:** Catppuccin Mocha across most of the stack - **Fonts:** Maple Mono / Maple Mono NF @@ -124,7 +124,7 @@ This repo also handles the machine itself, not just terminal tools. - [AeroSpace](https://github.com/nikitabobko/AeroSpace) tiling window manager config in [`dot_aerospace.toml`](dot_aerospace.toml) - [Karabiner-Elements](https://karabiner-elements.pqrs.org/) keyboard remapping in [`dot_config/private_karabiner/`](dot_config/private_karabiner/), including a `disable_cmd_tab.json` profile -- macOS defaults and shell/editor bootstrapping in [`run_once_settings.sh.tmpl`](run_once_settings.sh.tmpl) +- macOS defaults and shell/editor bootstrapping in [`run_once_settings.sh.tmpl`](.chezmoiscripts/run_once_settings.sh.tmpl) - launch agents in [`private_Library/LaunchAgents/`](private_Library/LaunchAgents/) - app defaults, file associations, Dock behavior, keyboard repeat, Touch ID for `sudo`, and similar setup tasks @@ -191,7 +191,7 @@ Package installation is split by machine type: - [`Brewfile.work`](Brewfile.work) - [`Brewfile.workstation`](Brewfile.workstation) -On first apply, [`run_once_install_packages.sh.tmpl`](run_once_install_packages.sh.tmpl) takes care of the rest. That script installs the Homebrew bundle, UV tools, GitHub CLI plugins, Yazi plugins, and Magic from Modular. +On first apply, [`run_once_install_packages.sh.tmpl`](.chezmoiscripts/run_once_install_packages.sh.tmpl) takes care of the rest. That script installs the Homebrew bundle, UV tools, GitHub CLI plugins, Yazi plugins, and Magic from Modular. Some notable pieces from the current setup: -- 2.51.2