resolve resource mapping input discrepancy according to actual implementation, adjusting the type accordingly

This commit is contained in:
Kiara Grouwstra 2025-07-20 17:10:53 +02:00
parent e668239f8a
commit cd097a7afd
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -17,10 +17,40 @@ let
functionType = import ./function.nix; functionType = import ./function.nix;
nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default; nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default;
configuration = mkOption {
description = "Configuration type declaring options to be set by operators";
type = optionType;
readOnly = true;
default = submoduleWith {
class = "fediversity-configuration";
modules = [
{
options = {
enable = lib.mkEnableOption {
description = "your Fediversity configuration";
};
applications = lib.mapAttrs (
_name: application:
mkOption {
description = application.description;
type = submoduleWith {
class = "fediversity-application-config";
modules = [ application.module ];
};
default = { };
}
) config.applications;
};
}
];
};
};
in in
{ {
_class = "fediversity-settings"; _class = "fediversity-settings";
options = { options = {
inherit configuration;
resources = mkOption { resources = mkOption {
description = "Collection of deployment resources that can be required by applications and policed by hosting providers"; description = "Collection of deployment resources that can be required by applications and policed by hosting providers";
type = attrsOf (submoduleWith { type = attrsOf (submoduleWith {
@ -130,7 +160,7 @@ in
}; };
readOnly = true; readOnly = true;
default = { default = {
input-type = application-requirements; input-type = configuration;
output-type = nixops4Deployment; output-type = nixops4Deployment;
}; };
}; };
@ -157,33 +187,5 @@ in
]; ];
}); });
}; };
configuration = mkOption {
description = "Configuration type declaring options to be set by operators";
type = optionType;
readOnly = true;
default = submoduleWith {
class = "fediversity-configuration";
modules = [
{
options = {
enable = lib.mkEnableOption {
description = "your Fediversity configuration";
};
applications = lib.mapAttrs (
_name: application:
mkOption {
description = application.description;
type = submoduleWith {
class = "fediversity-application-config";
modules = [ application.module ];
};
default = { };
}
) config.applications;
};
}
];
};
};
}; };
} }