This commit is contained in:
Valentin Gagarin 2025-07-01 17:52:37 +02:00
parent 5a3c6ae08f
commit 7880e7e6a0

View file

@ -51,7 +51,7 @@ in
}; };
config-mapping = mkOption { config-mapping = mkOption {
description = "Mapping of application configuration to deployment resources, a description of what an application needs to run"; description = "Mapping of application configuration to deployment resources, a description of what an application needs to run";
# TODO: type = (submodule application.config.module) -> (attrsOf (attrTag (map (name: resource: { ${name} = mkOption { type = resource.consumer; }; }) config.resources))) /* something like that */ # TODO: type = (submodule application.config.module) -> (attrsOf (attrTag (lib.mapAttrs' (name: resource: { ${name} = mkOption { type = resource.consumer; }; }) config.resources))) /* something like that */
}; };
}; };
}) })
@ -60,31 +60,26 @@ in
environments = mkOption { environments = mkOption {
description = "Run-time environments for Fediversity applications to be deployed to"; description = "Run-time environments for Fediversity applications to be deployed to";
type = attrsOf ( type = attrsOf (
submodule ( submodule (environment: {
{ config, ... }: class = "fediversity-environment";
{ options = {
class = "fediversity-environment"; resources = mkOption {
options = { description = "Resources made available by the hosting provider";
required-resources = mkOption { type = attrsOf (
description = "Resources required by configured applications"; attrTag (
# TODO: type = ? lib.mapAttrs' (name: resource: {
${name} = mkOption { type = resource.provider; };
}; }) config.resources
available-resources = mkOption { )
description = "Resources made available by the hosting provider"; );
# TODO: type = ?
};
resource-mapping = mkOption {
description = "Mapping of resources required by applications to available resources";
# TODO: type = ?
};
}; };
} 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
};
};
})
); );
}; };
}; };
}
};
};
} }