Context
dryvist/nix-claude-code is the canonical home for declarative Claude Code modules. JacobPEvans/nix-ai historically held a mature implementation under modules/claude/ (~2300 lines across 23 files) that pre-dates this repo. The architectural split is: only Claude-Code-specific stuff goes here; nix-ai keeps the broader AI CLI ecosystem (Gemini, Copilot, Codex, MLX, Maestro, MCP servers).
This issue tracks the multi-PR migration to bring nix-ai's Claude logic into this repo and switch nix-ai to consume it as a flake input.
Inventory — what to port
Compared current modules/ with JacobPEvans/nix-ai/modules/claude/ (as of 2026-05-22):
Already implemented here
core.nix (81 lines) — settings.json wiring
plugins.nix (36 lines) — basic plugin management
hooks.nix (20 lines)
mcp.nix (25 lines)
latest.nix (17 lines)
statusline/{default,powerline,ccstatusline,daniel3303}.nix — three themes
Missing — port from nix-ai
| nix-ai source |
Lines |
Notes |
| modules/claude/settings.nix |
300 |
Sophisticated settings.json builder (env, paths, permissions composition). Subsumes core.nix. |
| modules/claude/settings-env.nix |
68 |
Env var generation |
| modules/claude/settings-paths.nix |
18 |
Path option resolution |
| modules/claude/orphan-cleanup.nix |
90 |
Removes stale plugins/MCP servers on activation |
| modules/claude/components.nix |
75 |
Composes core+plugins+hooks+mcp+statusline |
| modules/claude/options-content.nix |
80 |
Output content rules options |
| modules/claude/options-events.nix |
50 |
Hook event options |
| modules/claude/options-runtime.nix |
125 |
Runtime/feature toggles |
| modules/claude/options-types.nix |
82 |
Type helpers (mkOption wrappers) |
| modules/claude/plugins/marketplaces.nix |
268 |
Curated marketplace list (data) |
| modules/claude/plugins/01-official.nix |
103 |
Anthropic-official plugin enablement |
| modules/claude/plugins/02-vendors.nix |
66 |
Vendor plugins |
| modules/claude/plugins/03-personal.nix |
50 |
Personal plugin list |
| modules/claude/plugins/04-community.nix |
148 |
Community plugins |
| modules/claude/plugins/05-specialty.nix |
122 |
Specialty plugins |
| modules/claude/plugins/default.nix |
49 |
Aggregator |
Total: ~1700 lines of Claude-only logic to port.
Do NOT port (not Claude-specific)
- fabric-curated-patterns.json — Fabric AI tool data
- bws_helper.py, bws-env.example, get-api-key.py — verify scope; if Claude-specific keep, if generic API key helper move to nix-ai
Out of scope here (will move separately)
- ai-assistant-instructions/agentsmd/ — universal AI config layer (rules, permissions, workflows). Per user: "will be moved to dryvist eventually" but is a separate effort.
Suggested PR sequence
Each PR should be self-contained and pass nix flake check. Recommended order minimizes per-PR breakage:
- PR 1: Port options-types.nix + options-runtime.nix + options-events.nix + options-content.nix — pure option definitions, no behavior change yet
- PR 2: Port settings-env.nix + settings-paths.nix + settings.nix (replaces current core.nix write logic)
- PR 3: Port plugins/marketplaces.nix (data)
- PR 4: Port plugin enablement modules (01-official through 05-specialty + default.nix)
- PR 5: Port components.nix + orphan-cleanup.nix (activation logic)
- PR 6: In nix-ai — add nix-claude-code as a flake input; rewire homeManagerModules.claude to import from there; delete modules/claude/ in nix-ai
- PR 7: In nix-darwin — verify it still works (no consumer changes expected since nix-ai's public API stays the same; just internal delegation)
Each PR includes:
- nix flake check passes
- A darwin-rebuild switch --override-input nix-claude-code "$PWD" test on at least one host
- A live Claude Code session smoke test before merge
Risks
- Option type drift: nix-ai's option types are mature; nix-claude-code may have introduced slightly different shapes. Need to harmonize without breaking nix-darwin consumers.
- Activation script order: orphan-cleanup runs at activation time. Must not race with plugin install logic.
- Plugin data shape: marketplaces.nix uses a specific schema. nix-claude-code's parseMarketplace.nix lib needs to accept this shape.
- Permission options: where do programs.claude.permissions.{allow,ask,deny} live? Both repos may define them; need single source of truth.
Acceptance
Context
dryvist/nix-claude-codeis the canonical home for declarative Claude Code modules.JacobPEvans/nix-aihistorically held a mature implementation undermodules/claude/(~2300 lines across 23 files) that pre-dates this repo. The architectural split is: only Claude-Code-specific stuff goes here; nix-ai keeps the broader AI CLI ecosystem (Gemini, Copilot, Codex, MLX, Maestro, MCP servers).This issue tracks the multi-PR migration to bring nix-ai's Claude logic into this repo and switch nix-ai to consume it as a flake input.
Inventory — what to port
Compared current
modules/withJacobPEvans/nix-ai/modules/claude/(as of 2026-05-22):Already implemented here
core.nix(81 lines) — settings.json wiringplugins.nix(36 lines) — basic plugin managementhooks.nix(20 lines)mcp.nix(25 lines)latest.nix(17 lines)statusline/{default,powerline,ccstatusline,daniel3303}.nix— three themesMissing — port from nix-ai
Total: ~1700 lines of Claude-only logic to port.
Do NOT port (not Claude-specific)
Out of scope here (will move separately)
Suggested PR sequence
Each PR should be self-contained and pass nix flake check. Recommended order minimizes per-PR breakage:
Each PR includes:
Risks
Acceptance