From 27f96b2504c7b1c45eea187206f98347765aa076 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Wed, 3 Sep 2025 14:07:53 +0200 Subject: [PATCH] fix data model issues introduced at #501 (#509) Signed-off-by: Kiara Grouwstra Reviewed-on: https://git.fediversity.eu/Fediversity/Fediversity/pulls/509 --- deployment/data-model.nix | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/deployment/data-model.nix b/deployment/data-model.nix index c010b75b..edd969a5 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -156,7 +156,16 @@ in type = functionType; readOnly = true; default = { - input-type = application-resources; + input-type = submodule { + options = { + deployment-name = mkOption { + type = types.str; + }; + required-resources = mkOption { + type = attrsOf application-resources; + }; + }; + }; output-type = deployment; implementation = environment.config.implementation; }; @@ -166,17 +175,29 @@ in type = submodule functionType; readOnly = true; default = { - input-type = config.configuration; - output-type = nixops4Deployment; + input-type = submodule { + options = { + deployment-name = mkOption { + type = types.str; + }; + configuration = mkOption { + type = config.configuration; + }; + }; + }; + output-type = deployment; implementation = - cfg: + { + deployment-name, + configuration, + }: # TODO: check cfg.enable.true let required-resources = lib.mapAttrs ( name: application-settings: config.applications.${name}.resources application-settings - ) cfg.applications; + ) configuration.applications; in - environment.config.resource-mapping.apply required-resources; + environment.config.resource-mapping.apply { inherit required-resources deployment-name; }; }; }; # TODO(@fricklerhandwerk): maybe this should be a separate thing such as `fediversity-setup`,