Although this solution has the downside of confusing hydra :-/
in job ‘tests.recurseForDerivations’:
error: --- TypeError --- hydra-eval-jobs
attribute 'tests.recurseForDerivations' is a Boolean, which is not supported
looks it’s wrapping the same concept (and I am actually not convinced it it helpful to have have the same concept available both as an attributed and a similarly named function … more cognitive load, as people need to know about the attribute and recognize what the function does when they see it. At least recurseForDerivations is documentd in the nixpkg manual…
Hydra doesn’t understand that, yeah. What pkgs/top-level/release.nix does is, as far as I know, convert all recurseForDerivation attributes to empty sets when generating the set of jobs which are then just ignored by Hydra. Unfortunately this nix expression is pretty convoluted and I can’t point you to the exact location where this is done on the spot.