New TeX Live withPackages function

Dummy question here (I am a NixOS beginner) :

texlive.withPackages (with ps; [ scheme-small collection-pstricks ])

I see a lot of commands like this with withPackages (most of the time with python), with p:, ps;,

Where can I find a proper documentation for this and how to use it ? I search a bit but nothing really convincing.

Accordinf to this discussion, it seems that it is package related. But again, the explanation does not go further.