forked from Fediversity/Fediversity
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu> Reviewed-on: Fediversity/Fediversity#509
This commit is contained in:
parent
09db4d6217
commit
27f96b2504
1 changed files with 27 additions and 6 deletions
|
@ -156,7 +156,16 @@ in
|
||||||
type = functionType;
|
type = functionType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
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;
|
output-type = deployment;
|
||||||
implementation = environment.config.implementation;
|
implementation = environment.config.implementation;
|
||||||
};
|
};
|
||||||
|
@ -166,17 +175,29 @@ in
|
||||||
type = submodule functionType;
|
type = submodule functionType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
default = {
|
||||||
input-type = config.configuration;
|
input-type = submodule {
|
||||||
output-type = nixops4Deployment;
|
options = {
|
||||||
|
deployment-name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
configuration = mkOption {
|
||||||
|
type = config.configuration;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
output-type = deployment;
|
||||||
implementation =
|
implementation =
|
||||||
cfg:
|
{
|
||||||
|
deployment-name,
|
||||||
|
configuration,
|
||||||
|
}:
|
||||||
# TODO: check cfg.enable.true
|
# TODO: check cfg.enable.true
|
||||||
let
|
let
|
||||||
required-resources = lib.mapAttrs (
|
required-resources = lib.mapAttrs (
|
||||||
name: application-settings: config.applications.${name}.resources application-settings
|
name: application-settings: config.applications.${name}.resources application-settings
|
||||||
) cfg.applications;
|
) configuration.applications;
|
||||||
in
|
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`,
|
# TODO(@fricklerhandwerk): maybe this should be a separate thing such as `fediversity-setup`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue