host$ ./install-guix-distrobox.sh
# the first run fails, is expected...
host$ distrobox enter --root guix
# yes, you have to re-run the installer
guix$ sudo GUIX_ALLOW_OVERWRITE=1 ./guix-install.sh
It installs guix under /var/guix on the host. I believe this should survive container re-creation.
With the toolbox approach, does the guix data get blown away if you have to re-create the container?
What other package? Toolbox (toolbx) is built-in on Silverblue. Distrobox is a “beefed up” version of Toolbox.
With toolbox or distrobox (they behave the same pretty much), removing the container will blow away the /gnu/store if you delete the container, so yes.
I’m late to the party, but I tried both a containerized distrobox approach and using ostree-prepare-root to add a /gnu mountpoint before deciding to create a custom bootc image. The ostree-prepare-root method was close, but broke passt networking for rootless containers. You can find my Containerfile here: https://codeberg.org/16levels/guix-silverblue
Sorry, I didn’t communicate clearly. I was complementing your toolbox approach because you didn’t have to rpm-ostree install distrobox, unlike me. That’s what I meant by “it would be nice not having to install another package”.
The distrobox approach is unaffected if you delete the container because I’m mounting host volumes into the container. I just ran distrobox rm --root guix and all of my data is still at /var/guix.
Ah, nice! I actually did stumble upon this during my research!
Unfortunately, I haven’t had time to learn more about bootc and the customizations kinda scared me off (just cuz I don’t understand them). I was hoping for just vanilla Silverblue+Guix.
Creating a custom OS image does seem to be the most correct way of doing it though. All of the other ways seem to have some odd drawbacks or issues.
I need to find some more time to learn more about bootc and how all of that stuff works with Silverblue.
The distrobox approach is unaffected if you delete the container
because I’m mounting host volumes into the container. I just ran distrobox rm --root guix and all of my data is still at /var/guix.
Ah ok, I get it now. Not sure if you can specify that with toolbx, but
it does seem like a benefit.
Did you try using two different distrobox containers against the same
store?