diff options
| author | 2026-05-13 13:43:21 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:21 +0100 | |
| commit | 32be4dc72b09caa91430a18d15b35622f166898e (patch) | |
| tree | 941731c229af6dcec987623b4a2c7af5a9c53b40 /README.md | |
| parent | c4020395efc666b7bd005d4774154cdbebb01b84 (diff) | |
| download | dotfiles-32be4dc72b09caa91430a18d15b35622f166898e.tar.gz dotfiles-32be4dc72b09caa91430a18d15b35622f166898e.tar.bz2 dotfiles-32be4dc72b09caa91430a18d15b35622f166898e.zip | |
refactor(units): split systemd-units into system/ and user/ trees
Move the three existing files into systemd-units/system/ and seed
systemd-units/user/ with a .ignore stub. Teach the unit-* recipes a
user:/system: group-token prefix (bare names keep system semantics for
back-compat). unit-apply and unit-status now walk both scopes; user
units go through 'systemctl --user' (no sudo), system units via 'sudo
systemctl' as before. Soft-fail per unit preserved for both scopes.
Top-level add/forget dispatchers need no changes: the unit-extension
sniff already routes anything ending in .service/.timer/etc to
unit-*, and user:base passes through as the group token.
Docs updated in README.md and .github/copilot-instructions.md.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 60 |
1 files changed, 30 insertions, 30 deletions
@@ -75,40 +75,40 @@ chezmoi apply -v Everything is driven by [just](https://just.systems/) recipes against four parallel models: -| Directory | Managed by | Purpose | -| ------------------------ | ------------------------------------------- | ------------------------------------------------------------------------------------------------ | -| `dot_*`, `private_dot_*` | chezmoi | Dotfiles deployed to `$HOME`. Prefixes: `dot_` → `.`, `private_` → `0600`, `executable_` → `+x`. | -| `meta/*.txt` | `just pkg-apply`, `just pkg-status` | Plain-text package lists (one per line, `#` comments). Groups: `base`, `dev`, `wayland`, etc. | -| `systemd-units/*.txt` | `just unit-apply`, `just unit-status` | Units to enable, paired by name with a `meta/` group (`base.txt` ↔ `base.txt`). | -| `etc/` | `run_onchange_after_deploy-etc.sh.tmpl` | System-level configs deployed to `/etc/` via a chezmoi onchange hook. | -| `firefox/` | `run_onchange_after_deploy-firefox.sh.tmpl` | LibreWolf `user-overrides.js` + `userChrome.css` (kept under the familiar `firefox/` name). | +| Directory | Managed by | Purpose | +| ----------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dot_*`, `private_dot_*` | chezmoi | Dotfiles deployed to `$HOME`. Prefixes: `dot_` → `.`, `private_` → `0600`, `executable_` → `+x`. | +| `meta/*.txt` | `just pkg-apply`, `just pkg-status` | Plain-text package lists (one per line, `#` comments). Groups: `base`, `dev`, `wayland`, etc. | +| `systemd-units/{system,user}/*.txt` | `just unit-apply`, `just unit-status` | Units to enable, split by scope. `system/` files pair by name with `meta/` groups (`system/base.txt` ↔ `meta/base.txt`); `user/` files are standalone. Recipe group token: `<name>` / `system:<name>` / `user:<name>`. | +| `etc/` | `run_onchange_after_deploy-etc.sh.tmpl` | System-level configs deployed to `/etc/` via a chezmoi onchange hook. | +| `firefox/` | `run_onchange_after_deploy-firefox.sh.tmpl` | LibreWolf `user-overrides.js` + `userChrome.css` (kept under the familiar `firefox/` name). | ## Recipes at a glance Run `just` or `just --list` for the full menu. Recipes follow a `DOMAIN-VERB` scheme across four domains (`dotfiles`, `etc`, `pkg`, `unit`) with chezmoi-aligned verbs (`add`, `forget`, `re-add`, `apply`, `diff`, `merge`, `status`). Top-level dispatchers sniff argument shape and delegate. -| Category | Recipe | Effect | -| ------------- | ------------------------------------------ | ---------------------------------------------------------------------------------- | -| Setup | `just init` | First-time setup: chezmoi init, git hooks, apply, base packages, curated units | -| Day-to-day | `just sync` | `apply` + `pkg-fix` + `unit-apply` (full reconcile) | -| | `just apply` | `chezmoi apply` — atomically deploys dotfiles AND /etc | -| | `just re-add [PATH]` | Pull live changes back into the repo (dotfiles + /etc) | -| Add / forget | `just add PATH` | Dispatches to `dotfiles-add` (path) or `etc-add` (`/etc/...`) | -| | `just add GROUP NAME…` | Dispatches to `pkg-add` (bare names) or `unit-add` (ends in `.service`/`.timer`/…) | -| | `just forget …` | Same shape as `add`; delegates to the right `*-forget` | -| Packages | `just pkg-apply [GROUP…]` | Install listed groups, or every group if none given | -| | `just pkg-fix` | Top up missing packages in already-adopted groups | -| | `just pkg-list [GROUP]` | Show per-group install coverage | -| Units | `just unit-apply` | Enable every unit in the adopted `systemd-units/*.txt` lists | -| | `just unit-list [GROUP]` | List curated units with their state | -| /etc | `just etc-diff`, `just etc-re-add`, | See /etc workflow below | -| | `just etc-restore`, `just etc-untrack` | | -| Inspection | `just status` | Combined dotfile + /etc + package + unit drift | -| | `just diff [PATH]`, `just merge [PATH]` | Dispatch to `dotfiles-*` or `etc-*` by path | -| | `just doctor` | Verify tooling for `just check` is installed | -| Quality gates | `just fmt [PATH]`, `just check-fmt [PATH]` | Format / check formatting (all languages below) | -| | `just lint [PATH]` | Run linters (selene, shellcheck, ruff, taplo) | -| | `just check [PATH]` | `check-fmt` + `lint` (the pre-commit hook and CI both run this) | +| Category | Recipe | Effect | +| ------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | +| Setup | `just init` | First-time setup: chezmoi init, git hooks, apply, base packages, curated units | +| Day-to-day | `just sync` | `apply` + `pkg-fix` + `unit-apply` (full reconcile) | +| | `just apply` | `chezmoi apply` — atomically deploys dotfiles AND /etc | +| | `just re-add [PATH]` | Pull live changes back into the repo (dotfiles + /etc) | +| Add / forget | `just add PATH` | Dispatches to `dotfiles-add` (path) or `etc-add` (`/etc/...`) | +| | `just add GROUP NAME…` | Dispatches to `pkg-add` (bare names) or `unit-add` (ends in `.service`/`.timer`/…) | +| | `just forget …` | Same shape as `add`; delegates to the right `*-forget` | +| Packages | `just pkg-apply [GROUP…]` | Install listed groups, or every group if none given | +| | `just pkg-fix` | Top up missing packages in already-adopted groups | +| | `just pkg-list [GROUP]` | Show per-group install coverage | +| Units | `just unit-apply` | Enable every unit in the adopted `systemd-units/{system,user}/*.txt` lists (system via `sudo`, user via `systemctl --user`) | +| | `just unit-list [GROUP]` | List curated units with their state | +| /etc | `just etc-diff`, `just etc-re-add`, | See /etc workflow below | +| | `just etc-restore`, `just etc-untrack` | | +| Inspection | `just status` | Combined dotfile + /etc + package + unit drift | +| | `just diff [PATH]`, `just merge [PATH]` | Dispatch to `dotfiles-*` or `etc-*` by path | +| | `just doctor` | Verify tooling for `just check` is installed | +| Quality gates | `just fmt [PATH]`, `just check-fmt [PATH]` | Format / check formatting (all languages below) | +| | `just lint [PATH]` | Run linters (selene, shellcheck, ruff, taplo) | +| | `just check [PATH]` | `check-fmt` + `lint` (the pre-commit hook and CI both run this) | `fmt` / `check-fmt` / `lint` cover: Lua (stylua, selene), shell (shfmt, shellcheck), Python (ruff), TOML (taplo), justfile (`just --fmt`), plus Markdown/JSON/YAML/CSS (prettier). Each accepts either no argument (whole repo) or a single file path. @@ -119,7 +119,7 @@ Four sources of drift are tracked independently and combined by `just status`: - **Dotfiles** (`just dotfiles-status`): live `$HOME` files differ from the repo. Resolve with `just apply` (repo → home), `just re-add PATH` (home → repo), `just diff PATH`, or `just merge PATH`. - **Packages** (`just pkg-status`): installed but undeclared, or declared but missing. Resolve by adding to a `meta/` group (`just add GROUP PKG`) or uninstalling. - **/etc** (`just etc-status` / `just etc-diff`): modified package configs or user-created files in `/etc` that aren't in the repo. Resolve with `just etc-re-add PATH` (track), `just etc-restore PATH` (revert to package default), or `just etc-untrack PATH`. -- **Units** (`just unit-status`): enabled units not in any `systemd-units/*.txt`, or declared units that aren't enabled. +- **Units** (`just unit-status`): enabled units not in any `systemd-units/{system,user}/*.txt`, or declared units that aren't enabled (checked for both scopes). ## Git hooks |
