`nix-env -qaP <text>` can't find Perl packages?

Why doesn’t a package search (nix-env -qaP <text>) not find existing Perl packages?

For example, I’m searching for the Perl package MIME::Lite, which is available according to the online search and installable as nix-env -iA nixpkgs.perl534Packages.MIMELite. It’s also listed in the full output of nix-env -qaP:

$ nix-env -qaP | grep -i MIMELite
nixpkgs.perl532Packages.MIMELite            perl5.32.1-MIME-Lite-3.031
nixpkgs.perl532Packages.MIMELiteHTML        perl5.32.1-MIME-Lite-HTML-1.24
nixpkgs.perl534Packages.MIMELite            perl5.34.0-MIME-Lite-3.031
nixpkgs.perl534Packages.MIMELiteHTML        perl5.34.0-MIME-Lite-HTML-1.24

But doing an explicit search like nix-env -qaP '.*MIMELite.* won’t see it:

$ nix-env -qaP '.*MIMELite.*'
error: selector '.*MIMELite.*' matches no derivations

Same as a naked string MIMELite, and same when run under sudo -i [1]. I have the same issue with packages under python39Packages.

For background, this is a newly-installed (multi-user) nix 2.5.1 on macos M1 (darwin-arm64), using channel nixpgs-unstable (the default, apparently) and I’m a noob with nix.

How can I search for language-specific packages at the CLI ?

[1] I’m still confused about the effects of the “invisible” channel, which is installed/visible to root but not for users, and adding the channel to a user causes the on nix-env operations: warning: name collision in input Nix expressions, skipping '/Users/jlargentaye/.nix-defexpr/channels_root/nixpkgs'

I think my issue was due my confusion between package names vs “attribute paths”, and case sensitivity. This search works:

$ nix-env -qaP '.*MIME.*Lite.*'
nixpkgs.perl532Packages.MIMELite      perl5.32.1-MIME-Lite-3.031
nixpkgs.perl532Packages.MIMELiteHTML  perl5.32.1-MIME-Lite-HTML-1.24
nixpkgs.perl534Packages.MIMELite      perl5.34.0-MIME-Lite-3.031
nixpkgs.perl534Packages.MIMELiteHTML  perl5.34.0-MIME-Lite-HTML-1.24

Note the .* between MIME and Lite, because the search is actually against the package name (the second field), not the first field which is package “attribute path” (as output with -P and used for installing.)

Also, the query is unfortunately case-sensitive, so searching for .*mime.*lite.* won’t work, and there doesn’t seem to be a way to make it case-insensitive (!?).

(As for my same issue with Python packages, I needed to search for the capitalization PyYAML)