Skip to main content
Declare the Claude Code you want. Apply. Roll it back with one command. Reproduce it on every machine.
Language: Nix  ·  Status: active  ·  Last active: this week  ·  Source on GitHub
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. Nix pins the version in flake.lock, rolls it back atomically with darwin-rebuild --rollback, and keeps it 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 by flake.lock, rolled back with the rest of your generation.
  • Permissions you can read. Auto-approved tools, deny lists, and the WebFetch allowlist live as structured Nix data. The same data feeds Codex, Antigravity, and any other AI agent you wire up. Codex runs through its own command-line runtime now, not an MCP tool, so mcp__codex__* is no longer in the allow list.
  • Statusline themes. Pick powerline, ccstatusline, or daniel3303 with a single option.
  • MCP plumbing. Surface programs.claude.mcpServers from your favorite MCP runtime; they wire into Claude’s settings.json exactly as the official plugin reference specifies. Most of the catalog is on-demand rather than always-on. See AI tooling.
  • Tool discovery pinned on. ENABLE_TOOL_SEARCH defaults to true, the always-defer setting, rather than the auto:N threshold that never deferred on a large context window.
  • Built on Anthropic’s spec. Reads .claude-plugin/marketplace.json and .claude-plugin/plugin.json per the upstream contract, with no proprietary formats.

How it fits

The declarative path to a Claude Code install. If you want a single fully configured Claude Code that survives a workstation wipe, this is the layer that produces it.
The four-repo Nix split each owns a slice of the install:
  • nix-darwin: system layer (macOS, Homebrew, security)
  • nix-home: user dev environment (shell, git, linters, credentials)
  • nix-ai: AI tool ecosystem (Claude Code binary, the Antigravity command-line tool, MCP servers, MLX modules)
  • nix-devenv: reusable per-language project shells
  • nix-claude-code (this page): declarative Claude Code configuration on top of the binary that nix-ai packages
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

1

Add the flake input

Add nix-claude-code.url = "github:dryvist/nix-claude-code?ref=vN" to your flake inputs, where vN is the current major tag. The flake lock holds the exact revision. Set nix-claude-code.inputs.nixpkgs.follows = "nixpkgs" and the same for home-manager so versions stay aligned.
2

Scaffold from a template

nix flake init -t "github:dryvist/nix-claude-code?ref=vN#minimal" (or #flake-parts if you already use flake-parts). The minimal template is the fastest way to see the wiring.
3

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.
4

Roll back if needed

darwin-rebuild --rollback (or the home-manager equivalent) reverts the entire Claude Code install (plugin set, permissions, hooks, MCP wiring) to the previous generation in one command.

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.