generalize function type to take types to fix un-nixops4 error Expected a module, but found a value of type "option-type"

This commit is contained in:
Kiara Grouwstra 2025-07-21 22:13:31 +02:00
parent 228365cdf0
commit 119620eb5e
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 7 additions and 7 deletions

View file

@ -9,6 +9,7 @@ let
attrsOf
attrTag
deferredModuleWith
submodule
submoduleWith
optionType
functionTo
@ -159,13 +160,13 @@ in
};
readOnly = true;
default = {
input-type = configuration;
input-type = submodule configuration;
output-type = raw;
};
};
deployment = mkOption {
description = "Generate a deployment from a configuration";
type = functionTo (submodule environment.config.resource-mapping.output-type);
type = functionTo environment.config.resource-mapping.output-type;
readOnly = true;
default =
cfg:

View file

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