6.6 KiB
CLAUDE.md
Repository overview
NixOS flake for the desktop host (user faumaray) in the dendritic layout:
every .nix file under modules/ is a flake-parts module, imported by
import-tree. Features ("aspects") are flake.modules.nixos.<name> and
flake.modules.homeManager.<name>; a host imports the aspects it wants.
Stack: flake-parts, home-manager (NixOS module), agenix, disko, lanzaboote
(Secure Boot), Hyprland (own flake and overlay) + Noctalia with an SDDM
greeter (no autologin), Stylix theming (opt-out: autoEnable = true), WezTerm,
Neovim (configuration from the private nvim input), Obsidian with a
declarative vault, Steam + Proton, proxy-suite with an AmneziaWG split tunnel
and a manual full-tunnel profile, Docker and a Gitea runner, Claude Code with MCP
servers, dev shells (Rust via fenix, C/C++, Vulkan) with dev, full AMD support.
The canonical remote is Gitea (https://git.faumaray.com/faumaray/NixOsConfig); GitHub is a secondary remote. Pull requests and issues are handled through the Gitea MCP tools.
flake.nix: inputs andnixConfig;outputsis flake-parts over import-tree ofmodules/.modules/flake/: glue: systems,meta(shared data), host construction (configurations.nixos), overlays, packages, apps, dev shell, dev shells (shells.<name>→devShells), formatter, checks.modules/users/:meta.owner, the user identity every aspect reads.modules/core/: thecoreaspect every host imports (nix, nixpkgs, boot, locale, networking, users, home-manager, facts for install-system; agenix joins it frommodules/security/secrets.nix).modules/<area>/: aspects (boot,hardware,security,network,dev,desktop,theme,cli,ai,gaming); one file can define the NixOS and the home-manager half of a feature. The exception ismodules/dev/shells/: plainperSystem.shells.<name>definitions, not aspects (mechanism inmodules/flake/shells.nix).modules/hosts/<name>/: a host: aspect lists and host-only values (modules/hosts/desktop/host.nix, plushardware.nixanddisks.nix).modules/installer/: the installer ISO.hosts/<name>/: files install-system writes (hardware-configuration.nix,disk-ids.json); not modules.pkgs/: install, key and secret helpers (nix run .#<app>; the apps are declared inmodules/flake/apps.nix) anddev, the dev shell helper (pkgs/dev-shell).patches/: patches to flake inputs, applied withapplyPatches(patches/proxy-suite/, used bymodules/network/proxy-suite.nix); drop one when upstream has the fix.secrets/:secrets.nix(recipients) and encrypted*.agefiles, all optional (login password, SSH keys,secrets/gitea-runner-token.age,secrets/tg-ws-proxy-secret.age,secrets/amneziawg-ai.age). Never commit plaintext orkeys/. A plaintext copy such as the gitignored/WG.confmust not stay in the repository: refer to the flake as.#..., never withpath:orbuiltins.getFlake, which would copy it into the Nix store.
Conventions: format with nix fmt (nixfmt). New behaviour is a new aspect,
not an enable option: importing an aspect enables it. Shared values come from
config.meta, bound in a let before any NixOS/home-manager module;
home-manager halves read the system through osConfig. Theming goes through
modules/theme/stylix.nix: Stylix themes every program it supports, and a
target is switched off there by name. Keep host files small.
Checks: nix eval .#nixosConfigurations.desktop.config.system.build.toplevel.drvPath
first, then nix flake check --no-build. The check is read-only and fails with
…-proxy-suite-flake-patched.drv is not valid when the store lacks the patched
proxy-suite tree (fresh clone or machine, nix flake update of nixpkgs or
proxy-suite, an edited patch, a garbage collection); the eval builds it, so rerun.
Evaluating the host fetches the private nvim input over SSH (with the key of
the user running nix) unless it is already in the store.
Multi-agent orchestration policy
Scope: this section applies only to the main session. Subagents
perform the role they were assigned (see .claude/agents/*.md) and do not
re-delegate it or act as orchestrators.
Roles
| Agent | Model / effort | Purpose |
|---|---|---|
| main session | fable / max (see .claude/settings.json) |
Orchestrator |
mao-designer |
opus / max | Designs, acceptance criteria, escalations |
mao-implementer |
sonnet / xhigh | Implements, tests, self-reviews |
mao-sonnet-reviewer |
sonnet / max | Independent implementation review |
mao-opus-reviewer |
opus / max | Final independent review |
mao-helper |
haiku | Searches, summaries, routine git |
Orchestrator duties
- The main session orchestrates. It decomposes work, delegates, tracks progress and attempt counts, resolves escalations, and reports results. It delegates implementation, investigation, testing and review to agents rather than doing them itself.
- Before delegating, define for each task: objective, scope, acceptance criteria, relevant files, and the expected report.
- Use named agents (the
mao-*agents above) so collaborators can address each other. - Parallelize independent work only. Never have two agents edit the same files at the same time.
- The implementer runs the relevant checks and self-reviews before reporting.
- Use a fresh
mao-sonnet-reviewerfor an independent implementation review. - Use a fresh
mao-opus-reviewerfor the final independent review of substantive code changes. Never reuse the design agent's conversation for this review.
Attempts and escalation
- Track failed attempts per task. An attempt is a proposed solution that was checked against the acceptance criteria. It is not one tool call.
- After 3 unsuccessful implementation attempts, stop Sonnet retries and
escalate to
mao-designer(Opus) with the evidence. - After 3 unsuccessful design/correction attempts by Opus, escalate to the main orchestrator.
- The orchestrator must then change the approach, narrow the task, or request necessary user input. Do not reset the counters and repeat the same loop.
Communication
- Use
SendMessagefor direct agent-to-agent communication when it is available. - Use
ListAgentsonly if it is actually exposed in the session. Otherwise use the known agent names, or relay through the orchestrator.
Reports
Every agent report must include: result, changed files, checks actually run (with real outcomes), unresolved issues, and attempt count. Report unavailable agents, models or tools, and any fallback used, explicitly.