Running NixOS from any Linux Distro in systemd-nspawn Containers


This has been really useful to me.

I run Silverblue in my main workstation (I just enjoy automatic updates of the base system and a home-manager userland).

In my NixOS installation I had a couple of NixOS containers running some services and managing them with NixOS is wonderful.

Now I can port those containers easily to Silverblue (or any Linux).

Although the tarball creation was pretty slow and I didn’t like it since I’m only deploying those containers in the same machine that builds them, so I modified it to leverage of the local /nix/store and create only the required files (most of them symlinked to /nix/store), now the container just bind mounts the local /nix/store and re-deployments are pretty fast: GitHub - aorith/media-stack: Personal media stack running in a NixOS systemd-nspawn container