I think I found the issue with what was killing my nixos-unstable-small builds. My "all NixOS systems" derivation makes the Nix process use around 31 GB RAM. This PC has 64 GB, so it worked fine without the small branch, but some other high-RAM build collided with this and triggered the OOM killer.

My setup is probably weird, I have a custom derivation that builds all my NixOS systems all at once, in part to simplify building everything, and to parallelize builds as much as possible. But I never realized just how much memory Nix uses for this.

For the record, I use Lix, but I doubt upstream Nix would be different.

@ihaveahax i assume this is during eval-time, rather than build-time?

@Qyriad Yes it's during eval.

Since posting this though, I found out that if I do a dry-run and get the drv file, I can build that file and nix/lix does not take up excessive memory.

@Qyriad

nix -v -L build "$(nix build .#everything --dry-run --json | jq -r '.[0].drvPath' -)^*"