nixpkgs manual: more extensible example (#15557)

By checking if the package name appears in a list, this new example allows for easy user-customization.

Changed files
+2 -2
doc
+2 -2
doc/configuration.xml
···
allowUnfreePredicate = (pkg: ...);
</programlisting>
-
Example to allow flash player only:
+
Example to allow flash player and visual studio code only:
<programlisting>
-
allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
+
allowUnfreePredicate = with builtins; (pkg: elem (parseDrvName pkg.name).name [ "flashplayer" "vscode" ]);
</programlisting>
</para>