From f2a35dec24cf2da40fbcf30794fb08806818cc44 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 eff30f76..b7d55ab0 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -116,7 +116,7 @@ in enable = lib.mkEnableOption "Hello in the shell"; }; }; - implementation = + resources = cfg: lib.optionalAttrs cfg.enable { dummy.login-shell.packages.hello = pkgs.hello; diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 6ab4f2d3..87dbe3db 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -71,7 +71,7 @@ in type = attrsOf (submoduleWith { class = "fediversity-application"; modules = [ - (application: { + { options = { description = mkOption { description = "Description to be shown in the application overview"; @@ -81,30 +81,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); }; }; - }) + } ]; }); };