Build Opencv 3.x with apps (createsamples, traincascade, ...)

Hello nixos community,

I am completely new to Nixos, so I am sorry if it is silly questions…

I use OpenCV in order to train and use Haar classifiers for object detection.
That is why I need to build opencv executables createsamples, traincascade which exist only in OpenCV 3.x.

Here is OpenCV repo:
and here are the applications I try to build:
It seems that there is a flag to build them as we can see in

I read the official Nixos OpenCV package but I don’t know how to modify it to build a custom OpenCV package with the apps executables I need (createsamples, traincascade).

Could you help me?