From 10a2d29e54c1defdd92541a7bc69f240e3c20bd7 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sun, 20 Jul 2025 16:34:02 +0200 Subject: [PATCH] untangle applications from function type, as they seem to not need the introspection (and may type-check input without it) --- deployment/data-model-test.nix | 2 +- deployment/data-model.nix | 26 ++++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index 541abed5..e8035139 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -118,7 +118,7 @@ in enable = lib.mkEnableOption "Hello in the shell"; }; }; - implementation = + resources = cfg: lib.optionalAttrs cfg.enable { _class = "fediversity-application-requirements"; diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 0f9142f1..48d1de93 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -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); }; }; - }) + } ]; }); };