> Then there is performance, it's very slow and uses a lot of memory making it impossible to use on a 512 MB vm, for example.
No, this is just a side effect of the CLI user experience being garbage.
`nix-env -i <regex>` is almost never what you want, because its semantics are to evaluate everything in nixpkgs, find the set of packages whose `name` attribute is matched by the given regex, and install all of the packages in that set modulo the equivalence relation generated by package `name` equality ignoring version numbers.
Instead, you should use `nix-env -iA <channel>.<attribute-path>`, where `<channel>` is the name of a Nix channel (viewable via `nix-channel --list`, usually it is `nixos` or `nixpkgs`) and `<attribute-path>` is a valid attribute path in the nixpkgs package set (these can be discovered by running `nix-repl '<nixpkgs>'` and tab-completing).