Install Claude Code through home-manager's native programs.claude-code module, matching how the tmux and fish Modules use their home-manager options rather than a raw home.packages entry. The feature Module at modules/claude-code/claude-code.nix stays thin — just the enable option and the delegation — and writes no settings, so login and first-run configuration remain interactive and no auth material enters the repo. Signing in without a browser (needed over the console or SSH) is documented in modules/claude-code/authentication.md: the paste-code OAuth flow, where the printed URL is opened on another device and the code pasted back, and the ANTHROPIC_API_KEY path for non-interactive use. The neogaia toplevel builds with claude-code-2.1.209 included.
2.5 KiB
2.5 KiB
spec, blocked-by
| spec | blocked-by |
|---|---|
| laptop-mvi | 0001-skeleton-and-building-host |
What to build
Install Claude Code declaratively on neogaia, and make it authenticatable without a browser on the laptop so it can be used over the console/SSH via the paste-code flow or an API key.
Acceptance criteria
- Claude Code is installed declaratively (following the
Enable conventionif expressed as aModule) and enabled onneogaia. - The browserless authentication path (paste-code flow or API key) is documented so it works over console/SSH.
- The
neogaiatoplevel still builds with Claude Code included.
Implementation Notes
- Native home-manager module, not a raw package. Claude Code is enabled through home-manager's own
programs.claude-codemodule (home-manager.users.<user>.programs.claude-code.enable = true), mirroring howtmux/fishuse their native home-manager options rather than dropping a package intohome.packages. The module ships within home-manager itself, so — unlikenvim/nixvim — no new flake input is needed. Per the invocation's steer to prefer the tmux/nvim conventions over the task wording, the featureModuleatmodules/claude-code/claude-code.nixis kept as thin as thetmuxmodule: just theenableoption and the delegation. - No settings written. The module manages no
~/.claudecontents and writes nosettings.json, so login and first-run configuration stay interactive. This keeps auth material (subscription token or API key) out of the repo. - Auth docs co-located with the module. The browserless authentication guide lives at
modules/claude-code/authentication.md, next to the module, following the repo pattern where each module directory holds its own supporting files. It covers both the paste-code OAuth flow (open the printed URL on another device, paste the code back — works unchanged over SSH) and theANTHROPIC_API_KEYpath. This is distinct from task 0009's OS-install docs, which coverdisko-install, not the CLI login. - Verification.
nix build .#checks.x86_64-linux.neogaia(the primary Host seam) builds the toplevel withclaude-code-2.1.209included;config.modules.claude-code.enableand the home-managerprograms.claude-code.enableboth evaluatetrue. - Note on flake evaluation. The new module file had to be
git added before the flake could see it — flakes evaluate the git tree, so an untracked Module is invisible to the Auto-loader and the host errors with "option does not exist".