diff --git a/deployment/data-model.nix b/deployment/data-model.nix index ab9f4daf..aa425b1a 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -85,13 +85,29 @@ in }; }; }; - deployments = mkOption { - description = "Deployment of a configuration of applications to a run-time environment"; - type = attrsOf deployment; - }; - migrations = mkOption { - description = "Migrations from Fediversity deployments to Fediversity run-time environments"; - type = attrsOf migration; + environments = mkOption { + description = "Run-time environments for Fediversity applications to be deployed to"; + type = attrsOf ( + submodule (environment: { + _class = "fediversity-environment"; + options = { + resources = mkOption { + description = "Resources made available by the hosting provider"; + type = attrsOf ( + attrTag ( + lib.mapAttrs' (name: resource: { + ${name} = mkOption { type = resource.provider; }; + }) config.resources + ) + ); + }; + resource-mapping = mkOption { + description = "Mapping of resources required by applications to available resources; the result can be deployed"; + # TODO: type = consumer-resources /* same as the output of application.config-mapping, should be in a `let` */ -> nixops4Deployment + }; + }; + }) + ); }; }; }