kepr.uk

ShellZigZonBuildNix

1 save · 4,004 lines · offered 18 hours ago · 153.6 KB · issues

$ koh steal kepr.uk/kepr.uk
·
28 files ⇓ bundle
1 save
e6b790build.zig reads KEPR_TARGET env var for Kepr cross-compile — falls back to standardTargetOptionsdev18 hours ago

Details

nina test VM — golden NixOS dev image

A reproducible NixOS 24.11 dev image for exercising nina, built once and booted as disposable copy-on-write overlays so every run starts from the exact same snapshot. Runs under qemu (TCG) on Apple Silicon — x86_64 emulation, so slow.

Files

  • configuration.nix — the golden system's exact starting state (the spec).

Serial console + root autologin (headless drivable), BIOS GRUB on /dev/vda, the brief's packages, ~/.nina.conf, hostname test-primary.

  • install.sh — runs inside the minimal installer: partition, nixos-install.
  • build-golden.sh — host orchestration: boots the ISO headless and drives the

scripted install over serial, producing the golden qcow2.

  • boot-overlay.sh — boots a throwaway overlay of the golden image, runs a

command (default: nina smoke test), discards the overlay.

Build the golden image (once, slow)

# needs the NixOS 24.11 minimal x86_64 ISO and a linux nina binary
./build-golden.sh /tmp/nixvm/nixos-24.11-minimal-x86_64.iso \
                  /tmp/nina-linux/bin/nina \
                  /tmp/nixvm/golden.qcow2

The linux nina binary comes from the nina repo: zig build -Dtarget=x86_64-linux-musl -Doptimize=ReleaseSafe -p /tmp/nina-linux.

Boot a disposable copy

./boot-overlay.sh /tmp/nixvm/golden.qcow2            # nina smoke test
./boot-overlay.sh /tmp/nixvm/golden.qcow2 'nina status'

The golden image is never mutated. Kiln can also boot it directly with kiln chamber run --os /tmp/nixvm/golden.qcow2 (fresh overlay per run).

Artifacts (ISO, golden.qcow2) live outside the repo (/tmp/nixvm); only the build inputs are version-controlled here.