Guix on Fedora Silverblue anyone?

Is anyone out there using Fedora Silverblue or any other immutable/atomic desktop with guix as a package manager?

I’m currently trying out Silverblue and I mostly like it. The one huge drawback is that I can’t seem to install Guix on this thing.

I found this: Running guix package manager on top of Fedora Silverblue, updated instructions

But it seems like a fragile way of running Guix that could break during any upgrade.

I was trying myself with distrobox, but couldn’t get a successful guix pull.

$ rpm-ostree override remove toolbox --install distrobox

$ sudo mkdir -p /var/guix/gnu/store /var/guix/guix /var/guix/etc/guix
$ distrobox create --name guix --image debian:13 --init --root \
	--volume /var/guix/gnu/store:/gnu/store \
	--volume /var/guix/guix:/var/guix \
	--volume /var/guix/etc/guix:/etc/guix
$ distrobox enter guix --root
# etc...

I was using this and had it working. Didn’t click the tutorial you linked, but here are my instructions and modified guix-daemon system service:

Modified systemd service

Sweet toolbox approach. It would be nice not having to install another package… hm…

I got the approach with distrobox working… it’s janky… but it seems like it’s working…

The script

$ cat install-guix-distrobox.sh 
#!/usr/bin/env bash
set -e

host_prefix=/var/guix

set -x
distrobox rm --root guix
rm -f guix-install.sh

sudo rm -rf $host_prefix
sudo mkdir -p "$host_prefix/gnu/store" "$host_prefix/var/guix" "$host_prefix/etc/guix" "$host_prefix/var/log/guix"

distrobox create --name guix --image debian:13 --init --root \
	--additional-packages "uidmap netbase" \
	--volume "$host_prefix/gnu/store:/gnu/store" \
	--volume "$host_prefix/var/guix:/var/guix" \
	--volume "$host_prefix/etc/guix:/etc/guix" \
	--volume "$host_prefix/var/log/guix:/var/log/guix"

curl -LO https://guix.gnu.org/guix-install.sh
chmod u+x guix-install.sh

distrobox enter --root guix -- sudo GUIX_ALLOW_OVERWRITE=1 ./guix-install.sh
set +x

echo "distrobox enter --root guix"
echo "then"
echo "sudo GUIX_ALLOW_OVERWRITE=1 ./guix-install.sh"

Using it

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.

Thanks!

wegei8 notifications@systemcrafters.discoursemail.com writes:

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?