The thunk trap
Why your Nix loop crashes after it finishes
Mika Bohinen - NixCon 2026

A capacity-planning tool sums requested memory across service configurations and can produce a diagnostic report. Asking for the memory total should not require generating the report. A strict fold can finish while leaving the total itself unevaluated, so reading it overflows the stack. Compute each new total before returning the record, while leaving diagnostics deferred. You only need to know Nix functions and attribute sets.