Ever spent hours configuring Claude Code plugins, Gemini settings, and MCP servers -- only to lose it all when you switch machines? nix-ai captures your entire AI setup as code using Nix. One command rebuilds everything, identically, every time.
| Tool | What you get |
|---|---|
| Claude Code | Plugins, marketplace, statusline, settings, autonomous agents, hooks |
| Gemini CLI | Settings, custom commands, permission rules |
| GitHub Copilot | Configuration, permissions |
| OpenAI Codex | Settings |
| MCP Servers | 15+ servers — GitHub, Terraform, Context7, PAL, filesystem, memory, and more |
| Plugin Marketplace | 14 curated plugin repositories |
| AI Dev Tools | cclint, doppler-mcp, claude-flow, sync-ollama-models |
| Ollama | Local model management with macOS launchd integration |
- Nix (Determinate Nix recommended)
- home-manager
- Compatible platform:
aarch64-darwinorx86_64-linux
Add to your Nix flake:
{
inputs.nix-ai = {
url = "github:JacobPEvans/nix-ai";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
}Then in your home-manager config:
sharedModules = [ nix-ai.homeManagerModules.default ];That's it. Every AI tool, every plugin, every permission rule — managed by Nix.
nix-ai exports home-manager modules that merge into your existing configuration:
| Export | What it includes |
|---|---|
homeManagerModules.default |
Full AI stack — Claude, Gemini, Copilot, Codex, MCP, Ollama, dev tools |
homeManagerModules.claude |
Just Claude Code |
homeManagerModules.maestro |
Just Maestro orchestration |
lib.ci.claudeSettingsJson |
Pure JSON for CI validation (no derivations needed) |
The module injects its own dependencies via _module.args. Your consuming flake only needs two lines:
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";No AI-specific inputs to wire up. No extra configuration. It just works.
Key enable toggles exposed by the default module:
| Option | Type | Default | Description |
|---|---|---|---|
programs.claude.enable |
bool | — | Enable Claude Code configuration |
programs.claude.apiKeyHelper.enable |
bool | false | Headless API key authentication via Bitwarden |
programs.claudeStatusline.enable |
bool | false | Claude Code powerline statusline |
programs.claude.settings.sandbox.enabled |
bool | false | Filesystem/network sandbox isolation |
programs.claude.settings.alwaysThinkingEnabled |
bool | true | Extended thinking mode |
programs.claude.remoteControlAtStartup |
bool or null | null | Remote Control auto-start |
programs.claude.model |
string or null | null | Override default model (e.g. "opus", "sonnet") |
programs.claude.effortLevel |
enum or null | null |
Adaptive reasoning effort ("low", "medium", "high"); null = upstream default (medium for Max/Team as of v2.1.68) |
programs.claude.trustedProjectDirs |
list of str | [] |
Base directories for auto-trust of CLAUDE.md imports |
For the full option set, see modules/claude/options.nix.
Run quality checks locally:
nix flake checkThis runs formatting (nixfmt), static analysis (statix), dead code detection (deadnix), shell script linting (shellcheck), and full module evaluation (module-eval) to verify the home-manager module instantiates correctly with real inputs.
Fix formatting automatically:
nix fmtmodules/
├── claude/ # Claude Code (settings, plugins, statusline, auto-claude)
├── maestro/ # Maestro agent orchestration
├── mcp/ # 15+ MCP server definitions
├── common/ # Shared permission engine
├── gh-extensions/ # GitHub CLI extensions (gh-aw)
├── permissions/ # Per-tool permission rules
├── ollama.nix # Local model management
├── ai-tools.nix # AI development tool packages
├── gemini.nix # Gemini CLI configuration
├── copilot.nix # GitHub Copilot configuration
└── codex.nix # OpenAI Codex configuration
lib/
├── claude-settings.nix # Pure settings generator
├── claude-registry.nix # Marketplace format functions
└── security-policies.nix # Permission policy engine
This repo is one of three that work together:
| Repo | What it does |
|---|---|
| nix-ai (you are here) | AI coding tools |
| nix-home | Dev environment (git, zsh, VS Code, tmux) |
| nix-darwin | macOS system config (consumes both) |
MIT