nix run and go.
Language: Nix · Status: active · Last active: this week · Source on GitHub
nix-ai is the package and config layer for everything AI-coding-related. It packages command-line
tools that don’t yet have first-party Nix derivations. It also pins MCP server versions and exports
overlays that the rest of the Nix stack consumes.
Host-specific provider wiring is intentionally outside nix-ai. If a tool needs
to point at a private local LLM gateway, package the tool here. Then keep the
endpoint configuration in the consuming workstation flake. That keeps
reusable packaging public and environment topology private.
What it does
- Packages Claude Code, the Antigravity (
agy) command-line tool, the GitHub Copilot command-line tool, Cribl and Splunk operator command-line tools, and assorted AI tooling - Tracks the operator command-line tool sources through the flake lock, so consumers can gate their installation to workstation hosts
- Provides MLX module derivations for Apple Silicon
- Pins a catalog of MCP servers and exposes them as reusable Nix attributes; most of the catalog is on-demand, not always-on (see below)
- Exports an overlay so
nix-darwinandnix-homecan include AI tools without duplicating logic - Includes a shell module (
devShells.default) for a ready-made AI sandbox - Adds the
zcode-jobpackage to the Darwin Home ManagerPATH; its connection configuration stays opt-in.
How it fits
Configuration surface
nix-ai ships as a reusable flake module with a single knob surface: modules/maintainer-profile.nix. This is the one file a consumer touches to adapt the stack:
- Identity fields (
user.fullName,user.trustedOrgs) have maintainer defaults, so derived values (for example, the Claude auto-mode trusted-org list) stay internally consistent. Override them for your own identity. - Infrastructure fields (
homelab.*,telemetry.*,trustedProjectDirs) default to clean/off/empty, so the module evaluates to a neutral config with zero consumer input. No personal context ships in the flake.
userConfig via _module.args. Only maintainer-profile.nix imports it directly.
To override a value, set it in your own nix-darwin config through extraSpecialArgs. You can
also import the module and set its options.
The nix-ai-open-harness Home Manager module
wraps nix-ai’s OpenCode module. Its default value for awesome-claude-skills
uses lib.mkDefault, so a consumer’s explicit module argument takes priority.
Environment variables
The variable catalog (required vs optional, purpose) lives in.env.example at the repo root.
Model endpoints and static MLX checks
Qwen Code uses the local LiteLLM URL when that proxy is enabled; otherwise it uses the endpoint selected byservices.aiStack. That selector defaults to the
on-host mlx_local endpoint (Qwen endpoint,
endpoint selector).
OpenCode’s router provider reads LLM_ROUTER_URL. Enabling local LiteLLM adds a
separate MLX provider at litellmLocal.baseUrl
(module).
The static resident checks under lib/checks/mlx-static-*.nix verify resident
server agents, catalog-derived limits, local routing and fallback behavior,
and cooldown settings (serving,
routing,
fallback).
Splunk MCP entry
The Splunk entry is one shared catalog item for the Claude and Codex tools. Qwen and Antigravity also use it through their command-line and IDE surfaces. Antigravity (agy) is the Gemini-family harness; it is not a second Gemini
MCP identity. Hermes uses the same Splunk connection.
On-demand MCP servers
MCP tool schemas are the largest addressable per-session token cost. So most local servers stay out of the always-on profile:apple-events, zammad,
fabric, grep, time, and token-meter render to
~/.claude/mcp-available/<name>.json instead of loading at session start.
The always-on profile carries only what the gateway routes (context7,
memory) plus vikunja. The Codex command-line tool can attach entries from
the on-demand registry by setting
programs.codex.onDemandMcpServers to
names in programs.aiMcp.onDemandEnabledServers. The configured servers are
rendered into Codex’s config.toml; remote servers can read their bearer token
from the named consumer environment variable at runtime. See the
Codex option
and renderer.
A repository attaches on-demand servers through its skill groups instead of listing
them by hand. programs.agentSkills.groupMcpServers maps a group to server names
(default homelab → zammad; ai → fabric, grep, time, token-meter). The
shared authoring category includes the agent-builder and skill-builder
skills for distribution to each supported harness. The direnv linker merges
the selected server names with any AGENTS.md mcp-servers: frontmatter. The result
goes into the managed part of an untracked .mcp.json. Ten rarely used Zammad tools stay denied by
bare-name permission rules so their schemas never reach context even when the server
attaches. The curated on-demand list is a config-level definition, so a consuming host
can append a server without losing the default set.
Getting started
1
Try a single tool
nix run "github:dryvist/nix-ai?ref=vN#claude-code" -- --help, where vN is the current major tag. No clone needed.2
Enter the sandbox shell
nix develop "github:dryvist/nix-ai?ref=vN" drops you into a shell with every AI command-line tool on PATH.3
Import into nix-darwin
Add
nix-ai as a flake input, then include nix-ai.overlays.default in your nixpkgs config. The README has the boilerplate.4
Override the maintainer profile
Set
userConfig.user.fullName and any homelab.* / telemetry.* options in your own config to adapt the stack to your environment.Related repos
Shared instructions
The shared instruction source used by the packaged AI tools.
claude-code-plugins
Extension layer on top of the packaged Claude Code CLI.
nix-darwin
The system-level consumer.
Local LLM
How the packaged MLX stack runs and is tuned on Apple Silicon.
Source on GitHub
Packages, overlays, full README.