agent/skills/tools/nh/SKILL.md
Switch NixOS/Home Manager configs with nh — cleaner interface for builds, switches, and garbage collection. Use when running os/home switch or pruning old generations.
npx skillsauth add knoopx/pi nhInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Cleaner interface for Nix operations — builds, switches, and garbage collection with readable output.
Build and activate a configuration:
nh os switch path:. # NixOS — build and activate
nh os test path:. # Build and test (rollback after timeout)
nh os build path:. # Build only, don't activate
nh os boot path:. # Make it the boot default without activating
Home Manager:
nh home switch path:. # Build and activate Home Manager config
nh home build path:. # Build only
macOS with nix-darwin:
nh darwin switch path:. # Build and activate darwin config
Path inference works — nh os switch uses the local flake.nix in the current directory. Prefix remote paths with path: to include untracked files.
Clean the Nix store and old generations:
nh clean all --keep-since 7d # Remove profiles older than 7 days
nh clean user --keep 5 # Keep last 5 user profiles
nh clean all # Full garbage collection
Search available packages:
nh search ripgrep # Search by name or description
Update flake inputs before building:
nh os switch --update path:. # Update inputs, then build and switch
--dry — show what would happen without making changes--ask — ask for confirmation (avoid in headless/automated scripts)tools
Inform the user what is happening — skip passive lookups
development
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
testing
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
content-media
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.