Agent MCP server + skill for managing your NixOS system
SaferSkills independently audited nix-agent (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
nix-agent is a pure Nix operations toolbox. It does NOT read or write files — use your own file tools (Read/Edit/Write) for that. It gives you the NixOS-specific operations: evaluate the live config, lint, format, validate, build, diff, switch, and manage generations.
Division of labor:
.nix files.All tools auto-resolve the target when flake_uri is omitted (/etc/nixos for NixOS, ~/.config/home-manager for Home Manager; the hostname / user@host attribute is picked automatically) and echo back resolved_target and the exact command run. Exception: calling format with explicit paths returns per-file results instead.
mode (read before any HM change)mode defaults to "nixos". Do NOT reflexively switch to "home-manager" just because the task touches Home Manager options — that is the most common way to operate on the wrong config.
home-manager.nixosModules.home-manager + home-manager.users.*): there is no separate home-manager switch. HM is built and activated as part of the system closure. Use mode="nixos" (the default) and switch the whole system. This is the common laptop/desktop layout.
homeConfigurations.*,applied with home-manager switch): use mode="home-manager".
If both a NixOS flake and a standalone ~/.config/home-manager flake exist on the machine, the standalone one is often vestigial — confirm which is actually active (eval_config against each, or check what the running generation was built from) before mutating. When in doubt, mode="nixos" is the safer guess.
For nonstandard or multi-flake layouts, don't rely on auto-resolution: set NIX_AGENT_FLAKE (or NIX_AGENT_HM_FLAKE) once, or pass an explicit flake_uri like /home/you/nixos#host. Either pins the target and removes the guesswork entirely.
eval_config(attr, flake_uri?, mode?) — final merged value of anyconfig attribute on THIS machine (after all modules/overlays). mcp-nixos tells you what an option means; this tells you what it is.
check(level, flake_uri?, mode?) — validation ladder, fast to slow:"lint" (statix + deadnix, structured findings list), "flake", "dry-build", "dry-activate" (NixOS only).
format(paths?, flake_uri?, mode?) — nix fmt / nixfmt.build(flake_uri?, mode?) — build the closure, no activation.diff(flake_uri?, mode?) — what a switch would change (packageadds/removes/version bumps). Show this to the user before switching.
switch(flake_uri?, mode?) — activate. Records rollback_generation.generations(action="list"|"rollback", mode?) — list or roll back.mcp-nixos for packages/options;eval_config to see what the user's machine currently resolves.
.nix files with your native file tools.format() then check("lint") — fix findings worth fixing.check("dry-build") — catches eval/build errors cheaply. On failure,first_error has the actionable line.
diff() — show the user what will change.switch() — report the result and rollback_generation.generations(action="rollback").Steps 3–5 are judgment calls, not gates — for a trivial change, going straight to switch is fine. Compose what the situation needs.
status="failed" — read first_error first, full output second.Fix the config and retry; don't retry blindly.
status="no_target" — pass an explicit flake_uri.status="tool_missing" — the named binary isn't on PATH (onlyhappens outside the flake-packaged install).
sops-nix/agenix and only edit references.
switch when the user asked only to check or preview;diff is the preview.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.