Compare commits

..

4 commits

2 changed files with 8 additions and 8 deletions

View file

@ -9,6 +9,7 @@ let
attrsOf attrsOf
attrTag attrTag
deferredModuleWith deferredModuleWith
submodule
submoduleWith submoduleWith
optionType optionType
functionTo functionTo
@ -169,7 +170,7 @@ in
}; };
implementation = mkOption { implementation = mkOption {
description = "Mapping of resources required by applications to available resources; the result can be deployed"; description = "Mapping of resources required by applications to available resources; the result can be deployed";
type = functionTo raw; type = functionTo environment.config.resource-mapping.output-type;
}; };
resource-mapping = mkOption { resource-mapping = mkOption {
description = "Function type for the mapping from resources to a (NixOps4) deployment"; description = "Function type for the mapping from resources to a (NixOps4) deployment";
@ -179,13 +180,13 @@ in
}; };
readOnly = true; readOnly = true;
default = { default = {
input-type = configuration; input-type = submodule configuration;
output-type = raw; output-type = raw;
}; };
}; };
deployment = mkOption { deployment = mkOption {
description = "Generate a deployment from a configuration"; description = "Generate a deployment from a configuration";
type = functionTo raw; type = functionTo environment.config.resource-mapping.output-type;
readOnly = true; readOnly = true;
default = default =
cfg: cfg:

View file

@ -5,7 +5,6 @@
let let
inherit (lib) mkOption types; inherit (lib) mkOption types;
inherit (types) inherit (types)
deferredModule
submodule submodule
functionTo functionTo
optionType optionType
@ -14,10 +13,10 @@ in
{ {
options = { options = {
input-type = mkOption { input-type = mkOption {
type = deferredModule; type = optionType;
}; };
output-type = mkOption { output-type = mkOption {
type = deferredModule; type = optionType;
}; };
function-type = mkOption { function-type = mkOption {
type = optionType; type = optionType;
@ -25,10 +24,10 @@ in
default = functionTo (submodule { default = functionTo (submodule {
options = { options = {
input = mkOption { input = mkOption {
type = submodule config.input-type; type = config.input-type;
}; };
output = mkOption { output = mkOption {
type = submodule config.output-type; type = config.output-type;
}; };
}; };
}); });