Reduce "nix-env -u" memory usage?

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