Skip to main content
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 by flake.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, 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.
  • Built on Anthropic’s spec. Reads .claude-plugin/marketplace.json and .claude-plugin/plugin.json per the upstream contract — no proprietary formats.

How it fits

Feeds intoConsumes
User environment (home.packages), AI tooling overlay, scheduled-routine hostai-assistant-instructions rule set, claude-code-plugins marketplace
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, Gemini CLI, 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" to your flake inputs. 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#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.