Files
dotfiles/modules/claude-code/claude-code.nix
alexion ccc08ff1d8 Add a Claude Code Module and enable it on neogaia (task 0008)
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.
2026-07-19 07:57:43 -04:00

23 lines
680 B
Nix

{
config,
lib,
...
}:
# Claude Code — Anthropic's CLI — for the primary user, installed declaratively
# through home-manager. home-manager ships the package and owns ~/.claude; no
# settings are written here, so login and first-run configuration stay
# interactive. Signing in without a browser, as needed over the console or SSH,
# is covered in ./authentication.md.
let
cfg = config.modules.claude-code;
user = config.user.name;
in
{
options.modules.claude-code.enable =
lib.mkEnableOption "Claude Code, Anthropic's CLI, installed via home-manager";
config = lib.mkIf cfg.enable {
home-manager.users.${user}.programs.claude-code.enable = true;
};
}