OOM-safety (zram / build-concurrency caps / nix-daemon cgroup) not shipped to adopters #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The protections that keep a big
nixos-rebuildfrom OOM-killing the desktop live only in the maintainer's privateconfiguration.nix, which adopters don't import:zramSwap(compressed in-RAM swap — release valve when a build spikes)nix.settings.max-jobs/coressystemd.services.nix-daemon.serviceConfigMemoryHigh/MemoryMaxcgroup capsSo an adopter on a modest-RAM machine with no disk swap hits the kernel OOM-killer mid-rebuild (observed: Brave reaped during a build on a 16GB laptop; the kernel had no swap release valve).
Impact
Medium — degrades the install experience on common hardware (laptops, low-RAM boxes), exactly the audience for a turnkey desktop.
Suggested fix
Move sane defaults into a core module (
modules/cache.nixalready ownsnix.settings). At minimum azramSwaprelease valve enabled bymkDefault, plus conservativemax-jobs/cores. Optionally anix-daemonmemory cgroup. UsemkDefaultso beefy hosts can override.Found while helping a friend adopt the template on existing NixOS.