I even had an agent build it's own sandbox. It's a systemd container that pulls in most of my host config, but only has access to a couple directories in my real home. There are so many "container/vm for your agent" projects on github: I built my own in an hour. The file is about 100 lines long; that's it.
Every change I make is committed and pushed. I have my OS history going back 6 years. My laptop and servers stay in sync with my setup for free. If I buy a new laptop (maybe someday), setup takes an hour, almost all unattended.
Depending on the role it may have a different set of packages, my edge firewall is obviously stripped way back.
But like you whenever there is friction, I now have my agent cook up a recipe or tool to remove it, and add it to the Flake repository.
Secrets are managed via a custom built system I have that needs going through a YubiKey to decrypt .age files on the fly.
On all machines that have similar roles I have the same tools, configured the same.
It’s so great. AI fixed the usability issue with Nix and NixOS, now it’s become a completely tailored to me computing environment.
It's nice to have a personal dev box and a travel laptop both using the same set up with tiny differences and then being able to do the same for CLI tools on a work laptop running within macOS.
It's just a single non-committed config file and a committed shell script with no git forks needed to customize it https://github.com/nickjj/dotfriedrice. A bunch of friends are using it and hundreds of others based on GitHub's stats.
Since I backup my home directory I can blow out and create a new system in however long it takes to run through the Arch installer and then invoke 1 command to set everything up. About 10-15 minutes to set up a fresh machine.
I'd consider NixOS if cross OS compatibility wasn't a concern but a shell script and Arch has been great a combo for building a custom set up from the ground up. It's something I've been doing for my dev environment for around 8 years now but only introduced a GUI in the last year once my ~12 year old hardware was compatible with native Linux so I could finally drop Windows with WSL 2.
I use a NixOS VM to contain my dev work with my agent, which itself is setup by Nix. This protects against supply chain attacks from package installs and other things that might go sideways with linters and other tooling.