I’m trying to put together a NixOS module for Glance, and one of the types in their configuration is a list of widgets that can be one of the multiple pre-defined ones. I know how to write individual types.submodule for each of the widgets, but I’m struggling with encoding the notion of “this option is a list and the valid types are one of these widgets”.
I can’t quite remember how types fold, and I’m not home to test how they do, but I believe it should be lib.types.listOf lib.types.oneOf [ rssWidgetType videosWidgetType hackerNewsWidgetType ].