forked from Fediversity/Fediversity
36 lines
667 B
Nix
36 lines
667 B
Nix
/**
|
|
Modular function type
|
|
*/
|
|
{ lib, ... }:
|
|
let
|
|
inherit (lib) mkOption types;
|
|
inherit (types)
|
|
submodule
|
|
functionTo
|
|
optionType
|
|
;
|
|
in
|
|
submodule (function: {
|
|
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 = function.config.input-type;
|
|
};
|
|
output = mkOption {
|
|
type = function.config.output-type;
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
})
|