forked from Fediversity/Fediversity
untangle applications from function type, as they seem to not need the introspection (and may type-check input without it)
This commit is contained in:
parent
9f43c8a278
commit
cce6a06bf3
2 changed files with 5 additions and 23 deletions
|
@ -118,7 +118,7 @@ in
|
|||
enable = lib.mkEnableOption "Hello in the shell";
|
||||
};
|
||||
};
|
||||
implementation =
|
||||
resources =
|
||||
cfg:
|
||||
lib.optionalAttrs cfg.enable {
|
||||
dummy.login-shell.packages.hello = pkgs.hello;
|
||||
|
|
|
@ -70,7 +70,7 @@ in
|
|||
type = attrsOf (submoduleWith {
|
||||
class = "fediversity-application";
|
||||
modules = [
|
||||
(application: {
|
||||
{
|
||||
options = {
|
||||
description = mkOption {
|
||||
description = "Description to be shown in the application overview";
|
||||
|
@ -80,30 +80,12 @@ in
|
|||
description = "Operator-facing configuration options for the application";
|
||||
type = deferredModuleWith { staticModules = [ { _class = "fediversity-application-config"; } ]; };
|
||||
};
|
||||
implementation = mkOption {
|
||||
description = "Mapping of application configuration to deployment resources, a description of what an application needs to run";
|
||||
type = application.config.config-mapping.function-type;
|
||||
};
|
||||
resources = mkOption {
|
||||
description = "Compute resources required by an application";
|
||||
type = functionTo application.config.config-mapping.output-type;
|
||||
readOnly = true;
|
||||
default = input: (application.config.implementation input).output;
|
||||
};
|
||||
config-mapping = mkOption {
|
||||
description = "Function type for the mapping from application configuration to required resources";
|
||||
type = submoduleWith {
|
||||
class = "module-function";
|
||||
modules = [ functionType ];
|
||||
};
|
||||
readOnly = true;
|
||||
default = {
|
||||
input-type = application.config.module;
|
||||
output-type = application-requirements;
|
||||
};
|
||||
description = "Mapping of application configuration to deployment resources, a description of what an application needs to run";
|
||||
type = functionTo (types.submodule application-requirements);
|
||||
};
|
||||
};
|
||||
})
|
||||
}
|
||||
];
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue