Install
$ agentstack add skill-jeff7712-nix-agent-nix-agent ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Nix Agent
Overview
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:
- Your native tools — read and edit
.nixfiles. mcp-nixos— discover packages and options (what exists, what it means).nix-agent— operate on the user's actual configuration (what their machine resolves, whether it builds, what a switch would change).
Tool Surface
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.
Picking 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.
- Integrated HM (Home Manager wired in as a NixOS module via
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.
- Standalone HM (its own flake exposing
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 any
config 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 (package
adds/removes/version bumps). Show this to the user before switching.
switch(flake_uri?, mode?)— activate. Recordsrollback_generation.generations(action="list"|"rollback", mode?)— list or roll back.
Recommended Workflow
- Discovery (if needed): query
mcp-nixosfor packages/options;
eval_config to see what the user's machine currently resolves.
- Edit
.nixfiles with your native file tools. format()thencheck("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 androllback_generation.- On regret:
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.
Failure Handling
status="failed"— readfirst_errorfirst, fulloutputsecond.
Fix the config and retry; don't retry blindly.
status="no_target"— pass an explicitflake_uri.status="tool_missing"— the named binary isn't on PATH (only
happens outside the flake-packaged install).
Hard Rules
- Never write secret payloads into config files; reference secrets via
sops-nix/agenix and only edit references.
- Never call
switchwhen the user asked only to check or preview;
diff is the preview.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: JEFF7712
- Source: JEFF7712/nix-agent
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.