fix data model issues introduced at #501

Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-09-03 14:07:12 +02:00
parent 09db4d6217
commit e5e07ce32b
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -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`,