We are not that far from there, using cross compilations and a few nix commands. See:
Unfortunately it’s inevitable to build such an image without (cross) compiling most of the world. So personally I don’t use this method.
Notably, our support for embedded devices is in a sense slightly better, since we are not so strict regarding the concept of Free software. For instance RaspberryPi’s kernel and it’s binary blobs are compiled on Hydra.
Naturally, we miss documentation so it’s a bit nontrivial to figure out what’s in that gist.
: I use https://balena.io/ .