Compare commits

..

3 commits

Author SHA1 Message Date
c6f82f2e0a
swap out the input types to hopefully trigger an evaluation error - unfortunately does not seem to work yet 2025-08-16 14:14:18 +02:00
e91061e69c
evaluate deployment a bit further
allowed fixing a few types, tho bad input types still work, and needs
commenting readOnly
2025-08-16 14:14:18 +02:00
ed240f0db1
try to modularly apply functions, hoping to fix input type checks
fix types
2025-08-16 14:13:53 +02:00
3 changed files with 5 additions and 4 deletions

View file

@ -185,6 +185,7 @@ in
deploymentFunction = lib.isFunction result.deploymentFunction;
getProviders = lib.isFunction result.getProviders;
};
deploy = lib.isFunction fediversity.deployments.example.deployment;
};
expected = {
number-of-resources = 1;

View file

@ -143,7 +143,7 @@ in
resource-mapping = mkOption {
description = "Function type for the mapping from resources to a (NixOps4) deployment";
type = functionType;
readOnly = true;
# readOnly = true;
default = {
# input-type = application-resources;
input-type = types.int;
@ -203,14 +203,14 @@ in
};
environment = mkOption {
description = "The run-time environment to deploy to";
type = options.environments.nestedType;
type = options.environments.type.nestedTypes.elemType;
};
# TODO(@fricklerhandwerk): maybe this should be a separate thing such as `fediversity-setup`,
# which makes explicit which applications and environments are available.
# then the deployments can simply be the result of the function application baked into this module.
deployment = mkOption {
description = "Generate a deployment from a configuration, by applying an environment's resource policies to the applications' resource mappings";
type = functionTo deployment.config.environment.resource-mapping.output-type;
type = deployment.config.environment.resource-mapping.output-type;
readOnly = true;
# TODO: check cfg.enable.true
default =

View file

@ -20,7 +20,7 @@ submodule (function: {
};
function-type = mkOption {
type = optionType;
readOnly = true;
# readOnly = true;
default = functionTo (submodule {
options = {
input = mkOption {