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;
|
||||
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`,
|
||||
|
|
Loading…
Add table
Reference in a new issue