This gets asked with some frequency on this forum.
Also, don’t use nix-env, and don’t put libraries in your environment.systemPackages and expect them to work. Use the options search (NixOS Search) and prefer those instead of packages (which don’t include config) wherever possible. This is where a “package” in pacman differs from a “package” in nix.
Some other context below. Of course you pick what you want to learn first.