diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/PLAN-dotfiles-separation.org | 90 |
1 files changed, 60 insertions, 30 deletions
diff --git a/docs/PLAN-dotfiles-separation.org b/docs/PLAN-dotfiles-separation.org index d835acd..99b81ac 100644 --- a/docs/PLAN-dotfiles-separation.org +++ b/docs/PLAN-dotfiles-separation.org @@ -5,7 +5,7 @@ * Overview Extract =dotfiles/= from the =archsetup= repo into a standalone repository at -=cjennings.net/archsetup-dotfiles.git=. Archsetup keeps the install logic; +=cjennings.net/dotfiles.git=. Archsetup keeps the install logic; dotfiles live in their own repo and get cloned-then-stowed at install time. Add a new =minimal/= stow target (Tier B — TUI-tooled headless server) for @@ -60,9 +60,14 @@ minimal/ ├── .bashrc.d/ # 6 files: aliases, emacs, fzf, git, media, utilities ├── .config/ │ ├── btop/ # TUI system monitor +│ ├── environment.d/ # PATH env (rofi/scripts entry stripped — GUI-only) +│ │ └── envvars.conf │ ├── htop/ # TUI system monitor │ ├── mc/ # TUI file manager │ ├── ranger/ # TUI file manager +│ ├── systemd/ +│ │ └── user/ +│ │ └── emacs.service # Emacs daemon — useful via ssh + emacsclient │ ├── tickrs/ # TUI stock ticker │ ├── topgrade.toml # CLI updater │ ├── user-dirs.dirs @@ -97,6 +102,8 @@ minimal/ | Daemons w/ creds | =mpd/= (personal =~cjennings/= paths), =transmission/= (bcrypt RPC pass), =yt-dlp/= (email in config) — separate cleanup | | Notification / fonts | =dunst/=, =fontconfig/=, =mimeapps.list= — GUI-related | | Personal dirs | =documents/=, =music/=, =pictures/= — content, not config | +| Display-only services | =systemd/user/geoclue-agent.service= — geolocation for gammastep red-shift; useless headless | +| TUI music client | =ncmpcpp= — TUI but tied to mpd, which is excluded for credentials; SSH-into-desktop use case is too niche to ship | ** SSH and GPG availability @@ -136,11 +143,11 @@ Three phases. Each is a discrete unit with a stopping point. Manual SSH step (Craig). Probably: #+begin_src bash -ssh git@cjennings.net "cd /srv/git && git init --bare archsetup-dotfiles.git" +ssh git@cjennings.net "cd /var/git && git init --bare dotfiles.git" #+end_src -Adjust path as needed for Craig's server layout. Confirm the final URL -(default assumption: =https://git.cjennings.net/archsetup-dotfiles.git=). +Confirmed URL: =https://git.cjennings.net/dotfiles.git= (anonymous HTTPS read +verified against existing repos at the same host on 2026-05-14). *** Step 1.2 — Extract dotfiles/ with filtered history @@ -156,8 +163,8 @@ Result: a fresh repo where every commit is rewritten to be about files inside =dotfiles/= only. Per-file history and attribution preserved across the 275 commits. -If =git-filter-repo= isn't installed, =pacman -S git-filter-repo= or -=pip install --user git-filter-repo=. +If =git-filter-repo= isn't installed, =pacman -S git-filter-repo= (it's in +=extra=). *** Step 1.3 — Add minimal/ tree @@ -174,11 +181,11 @@ In =/tmp/extract-dotfiles/=: *** Step 1.4 — Push to the new remote #+begin_src bash -git remote add origin https://git.cjennings.net/archsetup-dotfiles.git +git remote add origin https://git.cjennings.net/dotfiles.git git push -u origin main #+end_src -**Stops here.** =archsetup-dotfiles.git= exists at cjennings.net with +**Stops here.** =dotfiles.git= exists at cjennings.net with =common/=, =dwm/=, =hyprland/=, =minimal/=. Archsetup itself unchanged. No risk to running session or test infra. @@ -191,7 +198,7 @@ Under the existing "Git Repositories" block (after the =dwm_repo= / #+begin_example # Dotfiles -DOTFILES_REPO=https://git.cjennings.net/archsetup-dotfiles.git +DOTFILES_REPO=https://git.cjennings.net/dotfiles.git DOTFILES_BRANCH=main DOTFILES_DIR=$HOME/.dotfiles #+end_example @@ -206,7 +213,7 @@ Edits to =/home/cjennings/code/archsetup/archsetup=: 1. *Read config* (around line 114-122): map =DOTFILES_REPO= / =DOTFILES_BRANCH= / =DOTFILES_DIR= env vars to lowercase script variables. 2. *Set defaults* (around line 136-146, alongside =dwm_repo= etc.): - - =dotfiles_repo="${dotfiles_repo:-https://git.cjennings.net/archsetup-dotfiles.git}"= + - =dotfiles_repo="${dotfiles_repo:-https://git.cjennings.net/dotfiles.git}"= - =dotfiles_branch="${dotfiles_branch:-main}"= - =dotfiles_dir="${dotfiles_dir:-/home/$username/.dotfiles}"= 3. *Validate* (in =validate_config()=, around line 155+): security-only check on @@ -214,8 +221,9 @@ Edits to =/home/cjennings/code/archsetup/archsetup=: pattern as the existing =*_REPO= keys after =2c1377b=. 4. *Clone and stow* (in =user_customizations()=, currently around line 882-1010): - Replace the existing =dotfiles_dir="$user_archsetup_dir/dotfiles"= setup with - =git clone --depth 1 --branch "$dotfiles_branch" "$dotfiles_repo" "$dotfiles_dir"= - (run as the target user with =sudo -u= or =chown= after). + =sudo -u "$username" git clone --depth 1 --branch "$dotfiles_branch" "$dotfiles_repo" "$dotfiles_dir"= + (run as the target user; avoids a chown-after race if anything writes + during the clone). - Per Q5: error out if =[ ! -d "$dotfiles_dir/.git" ]= after the clone. - Stow target based on =$desktop_env=: + =dwm= → stow =common/= + =dwm/= @@ -227,11 +235,11 @@ Edits to =/home/cjennings/code/archsetup/archsetup=: *** Step 2.3 — Update test infra -1. =scripts/testing/archsetup-vm.conf=: add =DOTFILES_REPO=/tmp/archsetup-dotfiles-test= +1. =scripts/testing/archsetup-vm.conf=: add =DOTFILES_REPO=/tmp/dotfiles-test= (mirrors the =ARCHSETUP_REPO=/tmp/archsetup-test= pattern that's already there). 2. =scripts/testing/run-test.sh=: before VM launch, clone (or =cp -r=) the - dotfiles repo to =/tmp/archsetup-dotfiles-test= so the in-VM + dotfiles repo to =/tmp/dotfiles-test= so the in-VM =git clone "$dotfiles_repo"= against the local path succeeds. *** Step 2.4 — VM test @@ -241,8 +249,8 @@ Edits to =/home/cjennings/code/archsetup/archsetup=: - Stow pattern still works (=common/= + =hyprland/= go to =~/=). - No regressions from the install pre/post 2026-05-11 cleanup. -Optionally re-run with =DESKTOP_ENV=none= to validate the new =minimal/= -path. *Recommended* since it's the new code path. +Then re-run with =DESKTOP_ENV=none= to validate the new =minimal/= path. +*Required*, not optional — =minimal/= ships untested otherwise. **Stops here.** =dotfiles/= is still in the archsetup repo. Local machines (this one, ratio, velox) are still using =~/.config/foo → ~/code/archsetup/dotfiles/foo= @@ -252,16 +260,22 @@ symlinks — *no migration done yet*. Running session safe. *** Step 3.1 — Migrate this machine +Order matters — clone first so the new tree is ready, then unstow and +restow in immediate succession to minimize the gap when configs are missing: + #+begin_src bash +git clone https://git.cjennings.net/dotfiles.git ~/.dotfiles cd ~/code/archsetup make unstow hyprland # remove symlinks pointing at archsetup/dotfiles/ -git clone https://git.cjennings.net/archsetup-dotfiles.git ~/.dotfiles make stow hyprland DOTFILES=~/.dotfiles #+end_src -*Disturbs the running session briefly* — hyprland config, waybar, foot, -dunst, etc. all get unstowed and re-stowed mid-session. Reload after -(=hyprctl reload=, restart waybar/dunst). Verify nothing visibly broke. +*Don't run =hyprctl reload= or restart waybar/dunst between unstow and +stow* — those reads would hit missing config files and could error or +fall back to defaults. Hyprland keeps running with its in-memory config +across the swap, so the gap is invisible as long as nothing reads the +disk during it. After the stow finishes: =hyprctl reload=, restart waybar +and dunst, verify nothing visibly broke. Repeat for ratio and velox at appropriate times. @@ -271,7 +285,7 @@ Once all local machines are migrated: #+begin_src bash git rm -r dotfiles/ -git commit -m "chore(archsetup): remove dotfiles/ — moved to archsetup-dotfiles repo" +git commit -m "chore(archsetup): remove dotfiles/ — moved to dotfiles repo" #+end_src The directory is no longer needed since archsetup now clones from the @@ -283,12 +297,20 @@ Update the "Project Structure" and "Makefile Targets" sections to reflect the new layout. Document the =DOTFILES_REPO=, =DOTFILES_BRANCH=, and =DOTFILES_DIR= config keys. Note the =DOTFILES== Makefile override. +Also document the post-install update flow so a future maintainer knows +how to pull dotfile changes after archsetup runs: + +#+begin_src bash +cd ~/.dotfiles && git pull +cd ~/code/archsetup && make restow hyprland DOTFILES=~/.dotfiles +#+end_src + * Commit map Approximate commit boundaries for each phase. May split or combine as implementation reveals natural seams. -** Phase 1 commits (in the new archsetup-dotfiles.git repo) +** Phase 1 commits (in the new dotfiles.git repo) | C | Subject | |-----+-------------------------------------------------------------| @@ -307,7 +329,7 @@ implementation reveals natural seams. | C | Subject | |-----+-------------------------------------------------------------| -| A4 | chore(archsetup): remove dotfiles/ — moved to archsetup-dotfiles repo | +| A4 | chore(archsetup): remove dotfiles/ — moved to dotfiles repo | | A5 | docs: document external dotfiles layout in CLAUDE.md | * Open observations / future work @@ -332,6 +354,11 @@ These come up during the design but are out of scope for this work. as-is (real values, not templated) — the templating belongs in the broader =[#A] Prepare for GitHub open-source release= cluster, where it can be done as a single consistent pass. +- *Don't push the new dotfiles repo to GitHub until the secrets cleanup + ships.* The repo at cjennings.net is fine for real values — it's Craig's + private host. =minimal/.ssh/ssh.tar.gz.gpg= is GPG-encrypted (safe even + in public), but =.gitconfig=, =.ssh/config=, and other configs in the + tree carry personal info that shouldn't go on GitHub raw. - *Audit of dotfiles/common/ scripts.* The =[#B] Audit dotfiles/common directory= task in todo.org has unfinished subtasks for reviewing =.local/bin/= for unused scripts, orphaned configs, and unused stowed @@ -353,12 +380,15 @@ Pick a stopping point for this session: happens whenever the migration is convenient. 3. *All three phases* (~3-5 hours). Full end-to-end. Long session. -* Before starting +* Status (reviewed 2026-05-14) -Confirm: +All open questions resolved. Pre-flight is done; the next session reads +the spec body and executes Phase 1. -1. New repo URL (default assumption: =https://git.cjennings.net/archsetup-dotfiles.git=). -2. Path on cjennings.net for creating the bare repo (=/srv/git/=? other?). -3. Scope: 1, 2, or 3 above. -4. Anything in the =minimal/= tree that needs adjustment. -5. Anything in the implementation plan that needs adjustment. +| Item | Resolution | +|----------------------------+-------------------------------------------------------------------------| +| New repo URL | =https://git.cjennings.net/dotfiles.git= (anonymous HTTPS read verified)| +| Bare repo path | =/var/git/dotfiles.git= (alongside existing =/var/git/*.git= repos) | +| Scope for next session | Phase 1 only (~30 min) — repo + =minimal/= built and pushed | +| =minimal/= tree | Spec tree + =environment.d/envvars.conf= (rofi path stripped) + =systemd/user/emacs.service= | +| Phase 2 / Phase 3 | Constraints folded into the relevant sections; not executed today | |
