Use Claude Code to maintain NixOS server configs

A developer uses Claude Code to edit one NixOS config repo for several self-hosted machines, then reviews the diff and applies changes by hand.

Done with Claude Code· Intermediate· Oct 2026

What they did
They keep a single configuration repository that defines all of their NixOS machines, including two refurbished Lenovo laptops used as self-hosting servers. Claude Code works in that repo, but it is not allowed to run the command that would activate changes on a live system. Instead, the developer checks each edit and runs the system switch themselves.
How it went
This setup is how they manage services on those machines, including Nextcloud, Vaultwarden, and Jellyfin. The workflow is built around human review before anything reaches a live server.
Tips
Keep the agent limited to editing and dry checks, not deployment. Ask it to explain the changes clearly so you can approve them before you apply them.

Try it yourself with Claude Code

You are helping me maintain the NixOS config repo at [path] for these machines: [machine names]. Please make this change: [describe the config update]. You can edit files and run non-destructive checks, but do not run nixos-rebuild switch or any command that would apply changes to a live machine. After you finish, show me the full diff and explain it in plain language, then stop and wait for my approval before any step that would send, delete, submit, or activate changes.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.