Adds custom.services.gitea.actions-vm, running ephemeral act_runner
inside QEMU/KVM VMs alongside the existing nspawn Docker runner.
The Ubuntu 26.04 cloud qcow2 is fetched and customised inside
vmTools.runInLinuxVM. The image gets the act_runner closure plus
nodejs_24 copied into /nix/store, with each package's bin/* bulk-
symlinked into /usr/local/bin. A `runner` user (UID/GID 1001, HOME
/home/runner, locked password) is baked in to match GitHub-hosted
runner conventions, with passwordless sudo via /etc/sudoers.d/runner.
cloud-init is restricted to the NoCloud datasource so it applies
network-config quickly without scanning EC2/Azure endpoints, and
cloud-initramfs-growroot remains in place so partition + ext4 auto-
grow at boot.
At runtime each instance creates a fresh 40 GiB-virtual qcow2 overlay
backed by the read-only Nix-store image, registers an ephemeral
runner with Gitea, stages cloud-init meta-data + network-config
(static per-instance IP matched by MAC) alongside the resulting
.runner JSON and config.yaml, packages the lot into an ISO9660 disk
labelled cidata via xorriso, and launches qemu-system-x86_64 with
both disks plus a virtio-balloon device with free-page-reporting
enabled. cloud-init applies the network config; the in-VM
gitea-runner.service then runs as the `runner` user, mounts cidata
via ExecStartPre=+ and copies credentials into /var/lib/gitea-runner
before exec'ing act_runner directly.
A dedicated br-runners bridge handles networking with NAT to eth0 and
iptables FORWARD drops for RFC1918 and CGNAT ranges. Per-VM IPs are
assigned statically as 10.108.28.(10+i). qemu-bridge-helper is
capability-wrapped (cap_net_admin+ep) so the qemu process can attach
its TAP without holding cap_net_admin itself; the host service runs
as a fixed UID with NoNewPrivileges=false so the kernel honours the
file caps on exec (DynamicUser is incompatible — it implies and
enforces NoNewPrivileges, which would block the cap inheritance).
Disposable overlays use systemd CacheDirectory= under
/var/cache/gitea-actions-vm, persisted via a new
custom.impermanence.cache.extraDirs option so they land on the
SSD-backed /cache subvol (wiped on boot) rather than the tmpfs root.
Enables one instance on boron at 12 GiB / 6 vCPU.
Test plan:
- CI
- Migrated personal-agent with
JakeHillion/personal-agent#53 - all
looks good.