Starting work on NixOS Template

Hi. I’m working on a Guix template which is based on the same underlying technology as NixOS, so I’ll share where I’m at right now. It’s not very far.

Packaging Xen and Linux with QubesOS patches was fairly straightforward, as you might expect. I’ve also packaged qubes-db and started qubes-linux-utils, and again these were easy to package. I have a networking service that sets up the virtual interface correctly based on QubesDB and this was not too complicated, although I’ve had some problems with losing networking state if I disconnect my ethernet cable. Restarting the networking service fixes that. QubesDB has a function for monitoring changes to entries which might help solve that problem but I haven’t looked into it too much. Right now it’s just “run ip addr add/ip route add/etc on service start, equivalent delete commands on service stop, do nothing while the service is ‘running’”.

I’m currently working on booting my HVM Guix install in PVH mode. I’m starting with booting a Fedora-based template with a kernel built by Guix. Which is fine for the most part but memory ballooning isn’t working properly so I have to give the VM a lot of min memory. Otherwise it seems to work fine, the VM boots and I can do things in it. The next thing I need to tackle (aside from the ballooning bug) is starting the correct init in Guix. I assume that Nix will have a similar issue. In Guix, there is a list of bootloader entries pointing to different profiles in the kernel command line which is used during initialization. The problem is that the command line arguments live in dom0 when booting in PVH mode. Maybe some dom0 script could read the bootloader configuration and ask the user, but having dom0 parse VM data seems like a bad idea. So it would probably be better to have a separate init in Guix that asks the user which profile to use separately from the bootloader.

Anyway I’m short on time so that was just what I remember. Some of the pages in my personal note are relevant to my effort to build a Guix template and they might be helpful here as well. You can also see my current progress in my channel.

Good luck!

7 Likes