Shrinking NixOS RAM footprint and resource requirements to the bare minimum lowe...
HN Best 200 @best
Shrinking NixOS RAM footprint and resource requirements to the bare minimum lowendspirit.com · 17 points · 0 comments · HN thread
TL;DR A VPS hosting provider (TierHive) published a detailed write-up of how it cut a NixOS 26.05 template's idle RAM from about 288MB to 96MB and made a full rebuild finish within 512MB, mainly by disabling kernel features, trimming kernel modules and services, and tuning zram and the Boehm GC. The author shares the full working config and invites others to push it further. The thread has no comments yet.
- Stock NixOS idled at 288MB on a 1GB VPS, and a same-release rebuild needed 896MB; after the changes it idles at 96MB and a channel update plus rebuild peaks at 371MB on 512MB without OOM.
- Kernel-level savings include disabling allocation profiling, KFENCE, damon, audit, and transparent hugepages (THP alone freed about 52MB at 2GB, by reducing min_free_kbytes).
- A custom derivation trims the kernel module tree from 162MB to 45MB on disk by dropping sound, GPU, wifi, USB, NIC, SCSI/ATA and similar drivers while keeping dependencies.
- Userland cuts include disabling systemd-resolved, systemd-timesyncd (replaced by a oneshot busybox ntpd), systemd-oomd, and socket-activating sshd; idle userland is about 40MB PSS.
- zram with zstd at 100% capped at 512MB plus swappiness 180 makes rebuilds possible in 512MB, and GC environment variables cut Nix evaluation peak from 599MB to 548MB.
- Release jumps (26.05 to unstable) still fail at 512MB on first attempt after about 30 minutes; the author suggests more RAM or rerunning, and notes the target was a pre-release, so this may be specific to it.
Discussion The comment thread is empty: no comments have been posted yet, so there are no community views on the write-up. The post has 17 points, which suggests some readers found it interesting, but the discussion itself has not started.