$ show cleverca22/not-os
not-os is a minimal, embedded-focused Linux distribution built entirely as a Nixpkgs overlay, demonstrating how to construct a bootable OS from scratch (kernel, initrd, squashfs root) using NixOS modules while replacing systemd with runit. The repository provides configurations for x86_64 QEMU, Raspberry Pi (ARM), and Xilinx Zynq targets, along with an iPXE boot chain featuring cryptographic signature verification for secure boot. It illustrates advanced Nix techniques for building custom initrds, integrating firmware, and creating reproducible embedded system images, though some components (like the dummy stage-2 init script placeholder) indicate a focus on flexibility over polish. The codebase is well-structured with clear module boundaries and includes Hydra CI integration for automatic testing.
The LLM identified 3 files worth highlighting for reuse:
Constructs a minimal initrd (initial ramdisk) by copying busybox binaries and their dynamic libraries into a small rootfs, then patchelf'ing them to use the bundled glibc. It loads kernel modules, parses kernel command-line options for root and netroot, handles overlay filesystem setup for writable store support, and ultimately switches root to the final system. This is a sophisticated, self-contained pattern for creating a functional early-boot environment without systemd, reusable in any minimal Linux build.
Integrates the iPXE network bootloader with CMS cryptographic signing of kernel, initrd, root filesystem, and configuration script. It builds a custom iPXE binary that embeds a trust anchor and a verification script, enabling verified chain loading. The module also generates a TFTP directory with signed artifacts and a QEMU test runner. This pattern is reusable for any project requiring authenticated network boot.
Implements a full runit-based init system as a drop-in replacement for systemd in NixOS. It defines services for SSH, Nix daemon, and optionally rngd, along with runit stage scripts for hostname, IP configuration, and shutdown. The pattern demonstrates how to cleanly wrap an alternative init system in NixOS module syntax, including compatibility scripts for reboot/poweroff. It is reusable for any NixOS/Nix-based embedded system that wants to avoid systemd.