2026-08-17 20:35:29 +01:00
|
|
|
# Claude Code, configured declaratively via home-manager. Wanted on every host
|
|
|
|
|
# whose CPU can run it -- see the gate below.
|
2026-06-10 17:22:00 +01:00
|
|
|
#
|
2026-06-10 17:26:50 +01:00
|
|
|
# The STATIC config is managed here: the global CLAUDE.md (persona/context), the
|
|
|
|
|
# custom output style, and the auto-memory directory. settings.json is
|
|
|
|
|
# deliberately left UNMANAGED -- Claude Code rewrites it at runtime (interactive
|
|
|
|
|
# permission grants, /config), and a read-only /nix/store symlink would break
|
|
|
|
|
# those writes.
|
|
|
|
|
#
|
|
|
|
|
# Memory is the source of truth in this repo (./claude/memory). It is symlinked
|
|
|
|
|
# read-only into ~/.claude/memory, so the runtime "save a memory" path no longer
|
|
|
|
|
# writes there -- recall still works, but new/changed memories must be added to
|
|
|
|
|
# this repo and rebuilt. CLAUDE.md instructs Claude to do exactly that.
|
2026-08-17 20:35:29 +01:00
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
# Set by the NixOS/Darwin home-manager module; absent for the standalone
|
|
|
|
|
# homeConfigurations, hence the default.
|
|
|
|
|
osConfig ? { },
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
# Capability gate, declared once for the whole fleet in modules/features.nix
|
|
|
|
|
# (default: on; off on CPUs below x86-64-v2, which cannot run the Node
|
|
|
|
|
# runtime Claude Code ships on). Hosts without that option -- the Darwin host
|
|
|
|
|
# and the portable standalone profile -- fall back to enabled.
|
|
|
|
|
enable = osConfig.features.claudeCode.enable or true;
|
|
|
|
|
in
|
2026-06-10 17:22:00 +01:00
|
|
|
{
|
|
|
|
|
programs.claude-code = {
|
2026-08-17 20:35:29 +01:00
|
|
|
inherit enable;
|
2026-06-10 17:22:00 +01:00
|
|
|
# package defaults to pkgs.claude-code (tracked to unstable via the flake
|
2026-08-17 20:35:29 +01:00
|
|
|
# overlay).
|
2026-06-10 17:22:00 +01:00
|
|
|
|
2026-06-10 17:26:50 +01:00
|
|
|
# ~/.claude/CLAUDE.md -- global instructions / persona / memory workflow.
|
2026-06-10 17:22:00 +01:00
|
|
|
context = ./claude/CLAUDE.md;
|
|
|
|
|
};
|
|
|
|
|
|
2026-08-17 20:35:29 +01:00
|
|
|
# Nothing to place when the CLI is not installed: a ~/.claude/memory symlink
|
|
|
|
|
# with no Claude Code to read it is just dead state.
|
|
|
|
|
home.file = lib.mkIf enable {
|
2026-06-10 17:26:50 +01:00
|
|
|
# Custom output style. The module has no option for output-styles/, so place
|
|
|
|
|
# it directly; selection (settings.json `outputStyle`) stays mutable.
|
|
|
|
|
".claude/output-styles/soviet-engineer.md".source = ./claude/output-styles/soviet-engineer.md;
|
|
|
|
|
|
|
|
|
|
# Auto-memory directory, Nix-managed (read-only). Edit ./claude/memory in
|
|
|
|
|
# this repo and rebuild to change what Claude remembers.
|
|
|
|
|
".claude/memory".source = ./claude/memory;
|
|
|
|
|
};
|
2026-06-10 17:22:00 +01:00
|
|
|
}
|