I know that part is easy, i just nix-anywhere just yesterday to reinstall one of my servers. It's not what I'm talking about.

Okay, so your idea is that cloud providers should make this even easier?

    $ nixos-rebuild build-image --flake .#myhost --image-variant amazon
    $ aws-cli image upload < result/images/image.ami
    $ aws-cli create vm --image={image}