forked from Fediversity/Fediversity
resolve resource mapping input discrepancy according to actual implementation, adjusting the type accordingly
This commit is contained in:
parent
e668239f8a
commit
cd097a7afd
1 changed files with 31 additions and 29 deletions
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue