Skip to main content
Glama
nix-agent

nix-agent

by JEFF7712
README.md
<p align="center">
  <img src="assets/banner.png" alt="nix-agent: composable NixOS and Home Manager operations for AI agents" width="100%">
</p>

A local MCP server that gives AI agents composable NixOS / Home Manager
operations: build, diff, switch, and generations for the operational core,
plus eval, locate, and check for config introspection.

It pairs with [`mcp-nixos`](https://github.com/utensils/mcp-nixos). nix-agent
operates on your actual configuration, `mcp-nixos` handles package and option
discovery. Optional local usage logging (`NIX_AGENT_USAGE_LOG=1`) records
per-call byte accounting; run `nix-agent usage` to summarize.

The documented default is high trust: unprompted `switch` / `generations`
and passwordless sudo narrowed to this machine's flake. Lower trust (host
prompts, a sudo password) is an opt-down.

## Install

Paste this to a coding agent (Codex, Claude Code, opencode, ...) and it does the install:

```
Read https://raw.githubusercontent.com/JEFF7712/nix-agent/main/docs/agent-install.md and follow every step to install nix-agent on this NixOS system, install the companion skills, and register nix-agent in my MCP settings for this machine.
```

Or do it by hand, see [docs/usage.md](docs/usage.md#install).

## Docs

- [docs/usage.md](docs/usage.md): install, MCP host config, tool surface, workflow, design notes
- [docs/agent-install.md](docs/agent-install.md): high-trust install guide for agents
- [docs/privileged-automation.md](docs/privileged-automation.md): default non-interactive dry-activate, switch, and rollback (opt-down for a sudo password)
- [skills/nix-agent/SKILL.md](skills/nix-agent/SKILL.md): companion workflow skill
- [skills/nix-agent-init/SKILL.md](skills/nix-agent-init/SKILL.md): repo onboarding skill

The published documentation pages are generated directly from these Markdown files.

---

The nix-agent logo adapts the Nix snowflake from [NixOS/nixos-artwork](https://github.com/NixOS/nixos-artwork), licensed [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/).

TDQS

A3.9/5.0

Scored across 7 tools

Disambiguation4/5

The tools mostly have distinct roles: build/check/diff/switch/generations/eval_config/locate_option target different workflow stages. There is some overlap because build, check's dry-build, diff, and switch can all involve planning or evaluating a closure, but the descriptions make the intended primary action reasonably clear.

Naming Consistency3/5

Naming is readable but mixed: eval_config and locate_option follow a snake_case verb_noun pattern, while diff, generations, build, check, and switch are bare verbs or nouns. The inconsistency is not chaotic, but it lacks a predictable single convention.

Tool Count5/5

Seven tools is well-scoped for a NixOS/Home Manager configuration agent. Each tool covers a meaningful part of the build, validate, diff, inspect, and activate lifecycle without obvious redundancy.

Completeness4/5

The surface covers the core lifecycle well: build, validation, diff, activation, rollback/list generations, config evaluation, and option location. Minor gaps remain around direct file editing or broader Nix package/option discovery, but those may belong to a companion MCP server.

Maintenance

ActivityActive
ResponsivenessLimited data