Hah.
- The right solution appears to be checking for both
pnameandnameas showed here. - While parsing
pkg.pnameworks, it is redundant.Notice that you shouldn’t have to apply
builtins.parseDrvNametopkg.pname, as the latter already is the package name without the version suffix.
Example:
nixpkgs.config.allowUnfreePredicate =
(pkg: builtins.elem (pkg.pname or (builtins.parseDrvName pkg.name).name)
[ "unrar" ]);