The guide shows how a stock NixOS 26.05 virtual-machine setup was pared down to run on a 512 MB VPS. Initially, the system used about 288 MB while idle and needed roughly 896 MB to rebuild; after changes, it idled at 96 MB and completed a channel update and rebuild within 512 MB, with a 371 MB peak. The approach targets KVM guests rather than general-purpose machines: it disables kernel profiling and unused features, prevents loading hardware drivers and services the VPS does not need, and trims the kernel module tree while retaining dependencies. The author also disables systemd-resolved, replaces the resident time-sync service with a scheduled one-shot command, and activates SSH only when connections arrive.
The key to fitting rebuilds into limited memory is combining zram with Nix garbage-collector tuning and virtual-memory settings. Compressed swap peaked at 116 MB of real RAM during a rebuild, while earlier reclaim and reduced read-ahead helped avoid stalls. Other changes remove optional packages, documentation, and services, shrinking the compressed image from 607 MB to 477 MB, though disk reduction is not the main goal. The write-up notes trade-offs: some networking and hardware features are deliberately unavailable, and on-demand SSH may not suit every public server. A release upgrade from 26.05 to unstable still exceeded 512 MB on its first attempt; adding memory temporarily or retrying after downloads complete may be necessary.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.