From 8b070be38755f1af9e340dae84f1a74017efd810 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 21 Apr 2026 01:23:56 +0100 Subject: feat(etc): auto-apply in etc-reset/etc-rm + add etc-untrack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - etc-reset and etc-rm now chain 'just apply' at the end, so a single invocation leaves both repo and /etc consistent. - New etc-untrack recipe = etc-reset + etc-rm. One command to cleanly stop tracking an owned /etc file: before: just etc-reset X && just apply && just etc-rm X && just apply after : just etc-untrack X (etc-untrack doesn't apply to unowned files — use etc-rm.) --- .github/copilot-instructions.md | 2 +- justfile | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 20573d0..2a6fbdb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -21,7 +21,7 @@ The repo root is a chezmoi source directory. Files targeting `$HOME` use chezmoi - `bootstrap.sh` at the repo root is a POSIX shell script that takes a fresh minimal Arch install (only `base`) to a fully deployed state. It installs prerequisites, enables `%wheel` sudoers, bootstraps `paru-bin` from the AUR, clones the repo, runs `just init`, and optionally invokes `create-efi`. Designed to be curlable: `curl -fsSL .../bootstrap.sh | sh`. - `.chezmoiignore` excludes non-home files (`etc/`, `meta/`, `systemd-units/`, `firefox/`, docs) from deployment to `$HOME`. - `.githooks/` contains git hooks (notably `post-commit` which runs `chezmoi apply`). Activated by `just init`. -- `justfile` provides recipes: `init` (first-time setup), `sync` (apply + fix), `apply`, `fix`, `status`, `pkg-drift`, `dotfile-drift`, `undeclared`, `diff`, `merge`, `groups`, `install`, `install-all`, `add`, `remove`, `services`, `services-enable`, `services-drift`, `etc-drift`, `etc-diff`, `etc-upstream-diff`, `etc-add`, `etc-rm`, `etc-reset`. Run `just` or `just --list` to see them. +- `justfile` provides recipes: `init` (first-time setup), `sync` (apply + fix), `apply`, `fix`, `status`, `pkg-drift`, `dotfile-drift`, `undeclared`, `diff`, `merge`, `groups`, `install`, `install-all`, `add`, `remove`, `services`, `services-enable`, `services-drift`, `etc-drift`, `etc-diff`, `etc-upstream-diff`, `etc-add`, `etc-rm`, `etc-reset`, `etc-untrack`. Run `just` or `just --list` to see them. ## Window manager diff --git a/justfile b/justfile index 0094a12..ac6771a 100644 --- a/justfile +++ b/justfile @@ -354,10 +354,9 @@ etc-rm +paths: done echo "removed: $repo (/etc/$p left untouched)" done - echo - echo "Run 'just apply' to refresh the deploy-etc hash." + just apply -# Reset repo-managed etc/ to pristine pacman contents (run 'just apply' afterward) +# Reset repo-managed etc/ to pristine pacman contents and deploy etc-reset +paths: #!/usr/bin/env bash set -eo pipefail @@ -392,8 +391,12 @@ etc-reset +paths: bsdtar -xOf "$cache" "${live#/}" > "$repo" echo "reset (from $pkg): $repo" done - echo - echo "Run 'just apply' to deploy the pristine copy to /etc." + just apply + +# Stop tracking one or more /etc files: reset to pristine, deploy, then drop from repo +etc-untrack +paths: + just etc-reset {{ paths }} + just etc-rm {{ paths }} # ═══════════════════════════════════════════════════════════════════ # Package management -- cgit v1.2.3-70-g09d2