From cd097a7afd062a9f976a2b6ede197464ca52e204 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sun, 20 Jul 2025 17:10:53 +0200 Subject: [PATCH] resolve resource mapping input discrepancy according to actual implementation, adjusting the type accordingly --- deployment/data-model.nix | 60 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 0072fcf7..67238dd0 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -17,10 +17,40 @@ let functionType = import ./function.nix; nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default; + + configuration = mkOption { + description = "Configuration type declaring options to be set by operators"; + type = optionType; + readOnly = true; + default = submoduleWith { + class = "fediversity-configuration"; + modules = [ + { + options = { + enable = lib.mkEnableOption { + description = "your Fediversity configuration"; + }; + applications = lib.mapAttrs ( + _name: application: + mkOption { + description = application.description; + type = submoduleWith { + class = "fediversity-application-config"; + modules = [ application.module ]; + }; + default = { }; + } + ) config.applications; + }; + } + ]; + }; + }; in { _class = "fediversity-settings"; options = { + inherit configuration; resources = mkOption { description = "Collection of deployment resources that can be required by applications and policed by hosting providers"; type = attrsOf (submoduleWith { @@ -130,7 +160,7 @@ in }; readOnly = true; default = { - input-type = application-requirements; + input-type = configuration; output-type = nixops4Deployment; }; }; @@ -157,33 +187,5 @@ in ]; }); }; - configuration = mkOption { - description = "Configuration type declaring options to be set by operators"; - type = optionType; - readOnly = true; - default = submoduleWith { - class = "fediversity-configuration"; - modules = [ - { - options = { - enable = lib.mkEnableOption { - description = "your Fediversity configuration"; - }; - applications = lib.mapAttrs ( - _name: application: - mkOption { - description = application.description; - type = submoduleWith { - class = "fediversity-application-config"; - modules = [ application.module ]; - }; - default = { }; - } - ) config.applications; - }; - } - ]; - }; - }; }; }