/** Modular function type */ { config, lib, ... }: let inherit (lib) mkOption types; inherit (types) deferredModule submodule functionTo optionType ; in { options = { input-type = mkOption { type = deferredModule; }; output-type = mkOption { type = deferredModule; }; function-type = mkOption { type = optionType; readOnly = true; default = functionTo ( submodule (function: { options = { input = mkOption { type = submodule config.input-type; }; output = mkOption { type = submodule config.output-type; }; }; }) ); }; }; }