← Back to library

The agent edits your NixOS config, you apply it

wraptile, commenting on Hacker News, self-hosts on two refurbished laptops of about $250 each, joined by Tailscale and Cloudflare tunnels: one for private services like Nextcloud, Syncthing, restic and Vaultwarden, one for public apps. A single NixOS repo configures both through Claude Code, which may not run the rebuild; wraptile reviews and applies each change.

  • OutcomeKeep every home server's NixOS config in one repo the coding agent edits, and block it from applying changes so you review and switch yourself.
  • SetupAn afternoon+
  • LevelAdvanced
  • Creditwraptile on Hacker News
View original
Works with
Claude Code

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • You self-host services at home
  • You want declarative config
  • You can review diffs before applying

Not for: People new to Linux; Hosts you cannot reach if a change breaks networking

What do you need, and what do you get?

You need

  • Machines running NixOS
  • Config repo
  • Agent block list

You get

  • Config changes as reviewable diffs
  • Blocked apply command
  • Services managed from one repo

How does it work, step by step?

  1. One repoKeep the config for every machine in a single git repo.
  2. Block the switchDeny the agent the command that applies the config.
  3. Ask for changesHave it edit config for a new service or update.
  4. ReviewRead the diff and check what it changes.
  5. Apply yourselfRun the rebuild by hand and keep the previous generation for rollback.

The prompt

Our own prompt, inspired by wraptile on Hacker News and written to work in Claude Code. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt2 variables
Edit my NixOS config in {repo} to {change}. Do not run nixos-rebuild switch or any command that applies the config.
Show me the diff, explain what each change does, note any service restarts or network changes, and tell me how to roll back if it fails.

Inspired by wraptile on Hacker News: Comment in Ask HN: What do you run on a $5 VPS that's worth keeping online 24/7?. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • A bad network change can lock you out; keep local access.
  • Back up data separately from config.
  • Exposed services need updates; check them regularly.

Our take

What makes this setup work is that NixOS turns an entire machine into text, so an agent's change is just a diff you can read before anything happens. wraptile's one hard rule, that Claude Code can change files in the repo while the nixos-rebuild switch step stays off limits, splits the job cleanly: the model drafts, the owner decides. Copy that split exactly. Put the rebuild command on the agent's deny list rather than relying on a polite instruction, and read each diff with the same suspicion you would give a stranger's pull request, because a wrong firewall rule or a removed service only shows up after the switch. Keep a way to reach the console of the laptop you are changing, since a bad network change can lock you out of the box remotely. Remember that NixOS rollbacks restore configuration, not data, so the restic backups still matter. The hardware tip is underrated too: two old laptops sip power and replace a pair of rented servers. Splitting private and public services across them also limits the damage if a public app is ever compromised.

Where the time goes back: Home server changes become fast edits with a review step instead of risky console sessions.

FAQ

Why block the switch?
A person reads each diff before the system changes.
What hardware?
Two refurbished laptops with plenty of memory and low power use, per the self-hoster.

Source and credit

Inspired by wraptile on Hacker News. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Comment in Ask HN: What do you run on a $5 VPS that's worth keeping online 24/7?
Creator
wraptile on Hacker News
Published on
Hacker News
Original date
Oct 9, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Claude Code
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Privacy & Security

All 22 Privacy & Security playbooks →

Related playbooks

Privacy & SecurityRoutine✓ AI dry run

Approve a daily memory diff from your personal agent

Keep a personal agent's long-term memory accurate by reviewing a short daily list of proposed additions and edits before they are saved.

Credit: PrincessEe on Hacker News

An afternoon+
Privacy & SecurityPrompt✓ AI dry run

Declutter a Fire TV Stick with a coding agent, safely

Let a terminal coding agent connect to your Fire TV Stick over ADB on your home network, back up its state, switch off Amazon's ad and tracking options, disable unwanted apps a few at a time with your approval, and leave you a tested restore script.

Credit: u/Mean-Kaleidoscope873 on r/ClaudeCode

Under an hour
Privacy & SecurityWorkflow✓ AI dry run

Dictate new skills from your phone for small house chores

From your phone, have an assistant write small skills for local chores, run a daily brief, and fix its memory when it picks wrong.

Credit: Thomas Millar (@thmsmlr)

Under an hour
Privacy & SecurityPrompt✓ AI dry run

Hand small desktop jobs to your terminal agent

Hand a terminal agent the small, fiddly jobs on your own computer, from fixing photos and killing frozen apps to checking warranties, not just programming.

Credit: pta2la (@peta2la)

Minutes
Privacy & SecurityWorkflow✓ AI dry run

Harden a home AI agent before you start relying on it

Set up a self-hosted messaging agent so it cannot leak keys or answer strangers, recovers from crashes, and understands your context from the first conversation.

Credit: Aman Khan

An afternoon+