forked from Fediversity/Fediversity
37 lines
680 B
Nix
37 lines
680 B
Nix
/**
|
|
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 {
|
|
options = {
|
|
input = mkOption {
|
|
type = submodule config.input-type;
|
|
};
|
|
output = mkOption {
|
|
type = submodule config.output-type;
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
}
|