refactor(modules): relocate lib/modules/home out of the misleading "home" name #778

Merged
lytedev merged 1 commit from relocate-home-modules into main 2026-07-17 10:11:29 -05:00
Owner

lib/modules/home/ was documented as dead home-manager leftovers — but nothing in it is dead, it's only mis-named. It held exactly two live things:

  • claude/ — the source of the global ~/.claude/CLAUDE.md, the claude hook/notify/statusline bash, and commands/. Read at eval time by lib/modules/nixos/claude.nix, symlinked by it + opencode.nix.
  • scripts/ — 84 personal scripts (common/ + linux/) bundled onto $PATH via buildEnv in lib/modules/shared/shell-config.nix, imported by both the nixos and darwin module sets.

The home name is a fossil of the removed home-manager setup, and it made agents (and the AGENTS.md "dead code, do not edit" note) treat live, load-bearing files as untouchable — including your own global agent instructions.

Moves

from to
lib/modules/home/claude/ dotfiles/agents/claude/
lib/modules/home/scripts/{common,linux} lib/scripts/{common,linux}

dotfiles/agents/ is deliberately harness-agnostic (claude-specific bits nested under claude/), and putting the agent config under dotfiles/ matches the repo convention — content symlinked into ~, editable without a rebuild.

Rewiring

Every reference updated: claude.nix (eval-time readFile + devScriptsPath default + two userSymlink targets), opencode.nix (AGENTS.md symlink), shell-config.nix (both buildEnv paths). Removed the already-dead readme.md "Home Manager Modules" link (lib/modules/home/default.nix hasn't existed for some time).

Pure move + rewiring, no content changes (jj collapses it to renames: 7 insertions / 8 deletions).

Verification

  • The whole dragon host config evaluates — which forces the eval-time readFile of the moved claude scripts, so a wrong path would fail the eval.
  • Both moved symlink targets (CLAUDE.md, commands/speak.md) exist at their new paths.

Relationship to the other PRs

The AGENTS.md cleanup that finally deletes the "dead code" note lives on the docs-reconcile branch (#775), rebased on top of this. Recommend merging this first, then #775.

`lib/modules/home/` was documented as dead home-manager leftovers — but **nothing in it is dead, it's only mis-named.** It held exactly two live things: - **`claude/`** — the source of the global `~/.claude/CLAUDE.md`, the claude hook/notify/statusline bash, and `commands/`. Read at eval time by `lib/modules/nixos/claude.nix`, symlinked by it + `opencode.nix`. - **`scripts/`** — 84 personal scripts (`common/` + `linux/`) bundled onto `$PATH` via `buildEnv` in `lib/modules/shared/shell-config.nix`, imported by both the nixos and darwin module sets. The `home` name is a fossil of the removed home-manager setup, and it made agents (and the AGENTS.md "dead code, do not edit" note) treat live, load-bearing files as untouchable — including your own global agent instructions. ## Moves | from | to | |---|---| | `lib/modules/home/claude/` | `dotfiles/agents/claude/` | | `lib/modules/home/scripts/{common,linux}` | `lib/scripts/{common,linux}` | `dotfiles/agents/` is deliberately harness-agnostic (claude-specific bits nested under `claude/`), and putting the agent config under `dotfiles/` matches the repo convention — content symlinked into `~`, editable without a rebuild. ## Rewiring Every reference updated: `claude.nix` (eval-time `readFile` + `devScriptsPath` default + two userSymlink targets), `opencode.nix` (AGENTS.md symlink), `shell-config.nix` (both `buildEnv` paths). Removed the already-dead `readme.md` "Home Manager Modules" link (`lib/modules/home/default.nix` hasn't existed for some time). Pure move + rewiring, **no content changes** (jj collapses it to renames: 7 insertions / 8 deletions). ## Verification - The whole **dragon** host config evaluates — which forces the eval-time `readFile` of the moved claude scripts, so a wrong path would fail the eval. - Both moved symlink targets (`CLAUDE.md`, `commands/speak.md`) exist at their new paths. ## Relationship to the other PRs The AGENTS.md cleanup that finally **deletes** the "dead code" note lives on the docs-reconcile branch (#775), rebased on top of this. Recommend merging **this first**, then #775.
refactor(modules): relocate lib/modules/home out of the misleading "home" name
Some checks failed
/ check-format (push) Has been cancelled
/ build (push) Has been cancelled
bd21e694cc
lib/modules/home/ was documented as dead home-manager leftovers, but nothing in
it is dead — it is only MIS-NAMED. It held exactly two live things:

- claude/  — the source of the global ~/.claude/CLAUDE.md, the claude hook/
  notify/statusline bash, and the commands/. Read at eval time by
  lib/modules/nixos/claude.nix and symlinked by it + opencode.nix.
- scripts/ — 84 personal scripts (common/ + linux/) bundled onto PATH via
  buildEnv in lib/modules/shared/shell-config.nix, imported by both the nixos
  and darwin module sets.

The "home" name is a fossil of the removed home-manager setup and made agents
(and the AGENTS.md "dead code, do not edit" note) treat live, load-bearing files
as untouchable. Move them where they belong and the note can simply be deleted:

- claude/   -> dotfiles/agents/claude/   (harness-agnostic dotfiles/agents/ with
              the claude-specific bits under claude/; matches the repo dotfiles
              convention — content symlinked into home, editable without rebuild)
- scripts/  -> lib/scripts/{common,linux}

Rewired every reference: claude.nix (eval-time readFile + devScriptsPath default
+ two userSymlink targets), opencode.nix (AGENTS.md symlink), shell-config.nix
(both buildEnv paths). Removed the already-dead readme.md "Home Manager Modules"
link (lib/modules/home/default.nix has not existed for some time).

Pure move + rewiring, no content changes. Verified: the whole dragon host config
evaluates (which forces the eval-time readFile of the moved claude scripts), and
both moved symlink targets exist at their new paths.

The AGENTS.md doc cleanup that drops the "dead code" note rides on the docs-
reconcile branch (#775), rebased on top of this.
lytedev deleted branch relocate-home-modules 2026-07-17 10:11:29 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lytedev/nix!778
No description provided.