forked from fediversity/fediversity
WIP
This commit is contained in:
parent
5a3c6ae08f
commit
7880e7e6a0
1 changed files with 19 additions and 24 deletions
|
@ -51,7 +51,7 @@ in
|
||||||
};
|
};
|
||||||
config-mapping = mkOption {
|
config-mapping = mkOption {
|
||||||
description = "Mapping of application configuration to deployment resources, a description of what an application needs to run";
|
description = "Mapping of application configuration to deployment resources, a description of what an application needs to run";
|
||||||
# TODO: type = (submodule application.config.module) -> (attrsOf (attrTag (map (name: resource: { ${name} = mkOption { type = resource.consumer; }; }) config.resources))) /* something like that */
|
# TODO: type = (submodule application.config.module) -> (attrsOf (attrTag (lib.mapAttrs' (name: resource: { ${name} = mkOption { type = resource.consumer; }; }) config.resources))) /* something like that */
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
@ -60,31 +60,26 @@ in
|
||||||
environments = mkOption {
|
environments = mkOption {
|
||||||
description = "Run-time environments for Fediversity applications to be deployed to";
|
description = "Run-time environments for Fediversity applications to be deployed to";
|
||||||
type = attrsOf (
|
type = attrsOf (
|
||||||
submodule (
|
submodule (environment: {
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
class = "fediversity-environment";
|
class = "fediversity-environment";
|
||||||
options = {
|
options = {
|
||||||
required-resources = mkOption {
|
resources = mkOption {
|
||||||
description = "Resources required by configured applications";
|
|
||||||
# TODO: type = ?
|
|
||||||
|
|
||||||
};
|
|
||||||
available-resources = mkOption {
|
|
||||||
description = "Resources made available by the hosting provider";
|
description = "Resources made available by the hosting provider";
|
||||||
# TODO: type = ?
|
type = attrsOf (
|
||||||
|
attrTag (
|
||||||
|
lib.mapAttrs' (name: resource: {
|
||||||
|
${name} = mkOption { type = resource.provider; };
|
||||||
|
}) config.resources
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
resource-mapping = mkOption {
|
resource-mapping = mkOption {
|
||||||
description = "Mapping of resources required by applications to available resources";
|
description = "Mapping of resources required by applications to available resources; the result can be deployed";
|
||||||
# TODO: type = ?
|
# TODO: type = consumer-resources /* same as the output of application.config-mapping, should be in a `let` */ -> nixops4Deployment
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
)
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue