logoalt Hacker News

dark-star • today at 9:01 PM • 3 replies • view on HN

What's the advantage over any other Linux distro in a VM that you can checkpoint, refcopy and boot up in seconds? I'd rather let my AI agent run amok in a VM than on my actual production system


Replies

Cyph0n • today at 10:09 PM

You can also just run NixOS in a VM, which is what I would recommend to try it out.

Heck, you can even build & bake a NixOS VM purely using Nix - no Packer or Ansible (or other tools) required. Funnily enough, I just made a short video about this: https://youtu.be/Pb32C2inVhw.

As for why NixOS vs. another distro, it’s just amazing to be able to declaratively specify the state of your system and “build” that specification with some level of confidence that it will boot and it will work. And if it doesn’t work, you can atomically roll it back without having to solely rely on external (VM or filesystem) snapshots.

gf000 • today at 9:43 PM

You describe declaratively your whole system.

I have a single nix config repo that can build my home server, home PC and remote server all. They have a small shared part (terminal user settings etc), but it also sets up stuff like systemd services etc.

Like the whole *arr+jellyfin (download media) setup is just a couple of lines and it just works.

drdexebtjl • today at 9:22 PM

So run NixOS in a VM. The advantage is that when the agent does make some (useful) change to the system that you want to keep, the change will be reproducible so you can apply it on your clean checkpoint. On a traditional distro, you would have to checkpoint after the agent made the change, including not only the change, but all the state leading up to the change.

➕ show 1 reply