Re:Nix is the ultimate DevOps toolkit
by root_axis on Friday April 09, 2021 @08:26AM
(#26749655)
I love nix as a concept, but in my experience it isn't practical on systems without a ton of memory. I regularly get build errors due to oom errors.
[ Parent
| on HN ]
Re:Nix is the ultimate DevOps toolkit
by trulyrandom on Friday April 09, 2021 @09:46AM
(#26750496)
Yeah, it's clear that Nix has not been optimized to run on resource constrained devices. I run NixOS on a Raspberry Pi with 1GB of RAM and had to enable swap to prevent Nix from running into OOM situations. Any system with more memory than 1GB is usually fine in my experience though.
To run it on systems with low memory, I suggest performing any custom builds on a separate machine.
In "normal" circumstances you don't generally have to do any builds at all - (almost?) everything should come from the binary cache. To be doing all these rebuilds it sounds like you're customizing packages, which is already something other distributions don't tend to let you do at all.
That’s strange, are you actually compiling packages or the evaluation itself ooms?
Because if the former, you may help it by limiting concurrent builds.
Evaluating/compiling packages is not greedy.
Memory is eaten by lazy evaluation of NixOS modules.
It can be optimized, but it is not a low-hanging fruit. It is still waiting for its hero. I'd compare it with creating the V8 for JavaScript.
you're probably mistakenly using nix-env -i, rather than nix-env -iA