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:
Kiara Grouwstra 2025-07-20 16:34:02 +02:00
parent d429c32df0
commit 10a2d29e54
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 5 additions and 23 deletions

View file

@ -118,7 +118,7 @@ in
enable = lib.mkEnableOption "Hello in the shell";
};
};
implementation =
resources =
cfg:
lib.optionalAttrs cfg.enable {
_class = "fediversity-application-requirements";

View file

@ -72,7 +72,7 @@ in
type = attrsOf (submoduleWith {
class = "fediversity-application";
modules = [
(application: {
{
options = {
description = mkOption {
description = "Description to be shown in the application overview";
@ -82,30 +82,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);
};
};
})
}
];
});
};