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 {
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 {
description = "Run-time environments for Fediversity applications to be deployed to";
type = attrsOf (
submodule (
{ config, ... }:
{
class = "fediversity-environment";
options = {
required-resources = mkOption {
description = "Resources required by configured applications";
# TODO: type = ?
};
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 = ?
};
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
};
};
})
);
};
};
}
};
};
}