I have an old Dell MiniPC I’ve been hoping to repurpose (Dell Wyse 5010). It only has 4GBs of RAM and an AMD-GT48E.
I’ve heard that in these cases, you can offload the build process to a different computer to avoid freezing. But is there a “best practice” of what is currently considered the optimal way of doing this and the trade offs? I’ve seen people mention NixOps, but the github repo seems to explicitly dissuade usage of it now.
A complicating factor as well is that I plan on leaving the device for an extended period of time. I can set the system up, but the only machine I can really use as a build server is my laptop, which wouldn’t be on the same network as the MiniPC for months on end. Would this still be workable or would I need to rent a VPS?
nixos-rebuild can already use remote builders over SSH ootb, see the wiki page and man nixos-rebuild on your systems. The flags you’re interested in are --build-host and --target-host.
If you want more advanced management, you can look into deploy-rs or colmena. Note that this is third-party tooling.
*All of these would require being on the same network though, for SSH.
External builders only help so much. On highly RAM-constrained systems, the nix language evaluation can be a bigger bottleneck, actually, since you can’t avoid it by keeping to cached packages.
You can eval on another machine as well and remotely deploy, but it’s also surprisingly effective to just set up a generously sized zram swap in the constrained environment. I do fine on my pinephone pro with 4GB of ram that way, even with local builds of some packages.
Another important tip: set the nix config options cores and max-jobs to 1 to keep parallelism down and thus save RAM.
Does not being on the same network imply not being able to SSH between the two machines in either direction, even with intermediate jump hosts? If yes, it’s also the question of who will be using it, and is there a risk of auto-upgrade getting stuck with the user unable to notice/fix this.
https://nixbuild.net/ works pretty well in my experience and for your usecase there is a good chance you get by with the free quota.
But if you are on nixos stable channels you usually don’t need to build much from source anyway.
I’d keep an eye on htop too see which processes actually overload your computer. For me it’s usually rustc but the depends on what software you use of course.