Modeling random effects for blocks or sessions in Nilearn

Dear community,

I have a question about modeling a block-design experiment using the Nilearn/Nipype framework.

We have three levels: block, subject, and group (multiple trials per block, and multiple blocks per participant). We would love to compute whole-brain models with random effects at the block and the subject level. As far as my understanding goes, the glm.SecondLevelModel function models random effects at the subject/participant level. Any ideas on how to incorporate random effects for blocks? This could also apply to modeling multiple sessions within the same participant.

Thanks so much!