forked from Fediversity/Fediversity
39 lines
706 B
Nix
39 lines
706 B
Nix
/**
|
|
Modular function type
|
|
*/
|
|
{ lib, ... }:
|
|
let
|
|
inherit (lib) mkOption types;
|
|
inherit (types)
|
|
submodule
|
|
functionTo
|
|
optionType
|
|
;
|
|
in
|
|
submodule (
|
|
{ config, ... }:
|
|
{
|
|
options = {
|
|
input-type = mkOption {
|
|
type = optionType;
|
|
};
|
|
output-type = mkOption {
|
|
type = optionType;
|
|
};
|
|
function-type = mkOption {
|
|
type = optionType;
|
|
readOnly = true;
|
|
default = functionTo (submodule {
|
|
options = {
|
|
input = mkOption {
|
|
type = config.input-type;
|
|
};
|
|
output = mkOption {
|
|
type = config.output-type;
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
}
|
|
)
|