diary @ telent

Copying copy-closure#

Tue 09 May 2023 10:10:47 PM UTC

Topics: liminix

Shortly after all the work to reduce system closure size last time, I tried adding the necessary packages to support nix-copy-closure and saw it start building a complete C++ system with Boost. My fears that this would lead to quite a large increase in the system size were, it turned out, entirely founded.

So I wrote my own - or at least, a quite minimal substitute. The core logic is simple - on the sender, we get the list of required packages, then on the target we check for the existence of /nix/store/eeeeeeeeeeeeee-foo for each of them, and whatever's missing we send across the link using cpio.

It sounds simple, and it should be simple, and in retrospect it was simple. Along the way I went on a bit of a Qemu networking tangent and learned quite a lot about the bash coproc command

In other news I have also just pushed a small change to allow USB ethernet devices to be used with bordervm which should hopefully make it easier for people to set up a test internet for their hardware. This was not at all motivated by having had to remove the PCI ethernet card in my build system so I could plug in a video card to play motorbike games on instead, no, honest.

Update update#

Mon 22 May 2023 08:11:36 PM UTC

Topics: liminix

This week^Wfortnight I've added a liminix-rebuild command. It uses min-copy-closure to copy the systemConfiguration closure onto the device, then copies the activate binary (and some other bits) into /persist. Then it reboots the device, and the next time it comes up it will run the new activate.

It's not the full generational NixOS experience, but it's not nothing either.

I also spent some time bringing the User Manual up to date so that it describes how to build an updatable system and for balance why you might not want to. The manual is now a CI job, so it gets published to the web site on every change.

Next time

liminix-rebuild has significantly eased development friction: it's now convenient to talk to the device over SSH and I can install new packages/ update config without TFTPing 12MB images every time. So, it's time to turn my attention to rotuer.nix and make it a bit less shonky: