Adopt the convention that a Module's option path mirrors its directory under modules/, with an index file naming the directory's own segment. - Group agent Modules under modules.agents.*: claude-code (whole directory), pi (flattened to a file), skills (renamed from agent-skills), and gitea-axi under an agents/tools/ subgroup. The agents/ and tools/ folders are pure namespace prefixes with no aggregator enable. - Nest hypridle and hyprlock under modules.desktop.hyprland.*, with hyprland.nix as the index, and update the desktop aggregator. - Remove the obsolete example Module. - Record the convention in CONTEXT.md and ADR 0004, and update the neogaia host, the two live CLAUDE.md gotchas, and the skills Module's intentional Enable-convention exception comment.
4.1 KiB
What to build
Tidy the module tree so a Module's option namespace mirrors its directory under modules/, adopt that as a documented convention, group the agent-related Modules under a new agents/ directory, bring desktop/hyprland/ into conformance, and drop the obsolete reference Module.
The convention: a Module's option path mirrors its directory path, and a file whose name matches its directory is that directory's index node — it declares the directory's own segment (its enable/aggregator) rather than a doubled segment. A file foo.nix in directory d/ declares modules.<…>.d.foo. A group directory with no matching index file contributes a namespace segment but no aggregate enable.
Applying it:
- Agents grouping. Relocate the agent Modules under
modules.agents.*:claude-code(its whole directory, assets included) →modules.agents.claude-code;piflattened from its directory to a single file →modules.agents.pi; the skills Module renamed fromagent-skills→agents/skills.nix; andgitea-axiinto anagents/tools/subgroup →modules.agents.tools.gitea-axi.tools/is a real namespace segment, not a cosmetic folder. - No aggregators.
agents/andtools/are pure namespace prefixes — nomodules.agents.enableormodules.agents.tools.enable. Agents are enabled à la carte. - Skills stays enable-less. The skills Module keeps its current behaviour (unconditionally wires
programs.agents.skills, empty list); it is the one deliberate exception to the Enable convention, marked as intentional by a self-contained comment in the file. - Desktop conformance. Nest
hypridleandhyprlockundermodules.desktop.hyprland.*(matching the index-file rule,hyprland.nixbeing the index), and updatedesktop.nix's aggregator to the new paths. The 13 flatdesktop/*.nixModules keep theirmodules.desktop.<name>names — broader semantic regrouping is explicitly out of scope for this task. - Remove the example Module. Delete
modules/example.nix; the documented convention and the many real Modules supersede its teaching role.
Also update the one Host that carries these Modules and the live documentation, and record the convention in the domain model.
Acceptance criteria
CONTEXT.mdgains aNamespace conventionglossary entry stating the directory-mirrors-namespace rule and the index-file rule, in glossary style (no implementation detail).- An ADR (next number:
0004) records the decision — nested-mirrors-directory over flat names, a subfolder as a real namespace segment, the index-file rule, and noagentsaggregator — following the ADR format. - Agent Modules resolve under
modules.agents.*:modules.agents.claude-code.enable,modules.agents.pi.enable, andmodules.agents.tools.gitea-axi.enableexist;modules.claude-code,modules.pi, andmodules.gitea-axino longer resolve. - The skills Module lives at
agents/skills.nix(renamed fromagent-skills.nix), stays enable-less, still wiresprograms.agents.skills, and carries an in-file comment marking the Enable-convention exception as intentional. - Neither
modules.agents.enablenormodules.agents.tools.enableexists (pure namespace prefixes, no aggregator). claude-code's assets (CLAUDE.md,authentication.md,hooks/,skills/) travel with the move and its relative references still resolve.desktop/hyprland/:modules.desktop.hyprland.hypridleandmodules.desktop.hyprland.hyprlockresolve; the oldmodules.desktop.hypridle/modules.desktop.hyprlockno longer exist;desktop.nixenables the new paths;modules.desktop.enablestill brings up the whole session.modules/example.nixis removed andmodules.exampleno longer resolves.hosts/neogaia/default.nixuses the new option paths for claude-code, pi, and gitea-axi.- The two live
CLAUDE.mdgotchas — thegitea-axiinstall line and theclaude-codeskill-source path — are updated to the new option/path;.claude/tasks/*are left unchanged as historical record. nix flake checkbuildschecks.x86_64-linux.neogaiagreen (moved files staged so evaluation sees them).