NixOS/Home Manager 操作 MCP 服务

nix-agent 是一个本地 MCP 服务器,为 AI 代理提供可组合的 NixOS 与 Home Manager 配置操作,包括构建、差异比较、切换、世代回滚,以及 eval、locate、check 等配置检查能力,适用于需要在高信任模式下自动化管理真实 NixOS 系统的 AI 编程代理场景。

  • by JEFF7712
  • Python
  • 本地部署
  • 17 星标
  • 更新于
在 GitHub 查看 JEFF7712/nix-agent

使用说明

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

Experimental and a work in progress. Feedback and contributions welcome.

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

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


The nix-agent logo adapts the Nix snowflake from NixOS/nixos-artwork, licensed CC-BY 4.0.