Looks like there’s previous discussion of this here: nix-env uses a ton of memory · Issue #38635 · NixOS/nixpkgs · GitHub