Solution Strategy¶
LibreToy is built on NixOS and flakes: one codebase describes the system, and builds are reproducible.
- Two deliverables from one codebase. The full image — kernel and initrd included — is the default. The minimal image carries the bootloader only, is an official deliverable, and is grown to the device size from the host after copying.
- One builder, one configuration.
mkLibreToyImagebuilds both deliverables from the declarative configuration: partition table, filesystems and bootloader, plus kernel and initrd for the full variant. The same configuration driveslibretoy-ddwhile flashing andlibretoy-liveon the device, so partitions and images can change without writing the stick anew. - GRUB boots the images. GRUB with
grub-iso-multibootstarts copied images by loopback, and can be extended with further mechanisms. - The
libretoy-livebootloader entry. A dedicated boot entry lets the user boot an existing image, repartition the stick, or download systems from the catalog — at every boot, and under the user's control. - The catalog is a flake module. The initrd evaluates the current upstream flake to reach it.