Declare the Claude Code you want. Apply. Roll it back with one command. Reproduce it on every machine.
nix-claude-code ships Claude Code as composable home-manager modules. Marketplaces, plugins, statusline themes, hooks, MCP servers, and permission rules are all declared as Nix data — version-pinned in flake.lock, atomically rolled back with darwin-rebuild --rollback, identical across macOS and Linux.
What you get
- Every marketplace, wired up. Anthropic’s official marketplaces (
claude-plugins-official,anthropic-agent-skills) plus 15+ curated community marketplaces, refreshing automatically. - Plugins as data. Every plugin you enable lands in
programs.claude.enabledPlugins, pinned byflake.lock, rolled back with the rest of your generation. - Permissions you can read. Auto-approved tools, deny lists, and the WebFetch allowlist as structured Nix data — the same data feeds Codex, Gemini, and any other AI agent you wire up.
- Statusline themes. Pick
powerline,ccstatusline, ordaniel3303with a single option. - MCP plumbing. Surface
programs.claude.mcpServersfrom your favorite MCP runtime; they wire into Claude’ssettings.jsonexactly as the official plugin reference specifies. - Built on Anthropic’s spec. Reads
.claude-plugin/marketplace.jsonand.claude-plugin/plugin.jsonper the upstream contract — no proprietary formats.
How it fits
| Feeds into | Consumes |
|---|---|
| User environment (home.packages), AI tooling overlay, scheduled-routine host | ai-assistant-instructions rule set, claude-code-plugins marketplace |
nix-darwin— system layer (macOS, Homebrew, security)nix-home— user dev environment (shell, git, linters, credentials)nix-ai— AI tool ecosystem (Claude Code binary, Gemini CLI, MCP servers, MLX modules)nix-devenv— reusable per-language project shellsnix-claude-code(this page) — declarative Claude Code configuration on top of the binary thatnix-aipackages
nix-ai answers “where does the Claude Code binary come from?”; nix-claude-code answers “which plugins, hooks, MCP servers, and permissions should it have when it starts?”.
Getting started
Add the flake input
Add
nix-claude-code.url = "github:dryvist/nix-claude-code" to your flake inputs. Set nix-claude-code.inputs.nixpkgs.follows = "nixpkgs" and the same for home-manager so versions stay aligned.Scaffold from a template
nix flake init -t github:dryvist/nix-claude-code#minimal (or #flake-parts if you already use flake-parts). The minimal template is the fastest way to see the wiring.Declare the install
Set
programs.claude.enabledPlugins, programs.claude.mcpServers, and programs.claude.permissions in your home-manager config. Run home-manager switch or darwin-rebuild switch.Where to go next
nix-ai
The binary layer this configures.
nix-home
Where the home-manager modules attach to your user env.
claude-code-plugins
The marketplace this can install plugins from.
Scheduled routines
The cloud cron sibling that uses the same Claude Code install pattern.
Source on GitHub
Modules, templates, full README.