From 119620eb5ec1b13e670e96ce19368c75663022e8 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Mon, 21 Jul 2025 22:13:31 +0200 Subject: [PATCH] generalize function type to take types to fix un-nixops4 error `Expected a module, but found a value of type "option-type"` --- deployment/data-model.nix | 5 +++-- deployment/function.nix | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 09a6ea1b..794a76e2 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -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: diff --git a/deployment/function.nix b/deployment/function.nix index d1a047f0..f0210a34 100644 --- a/deployment/function.nix +++ b/deployment/function.nix @@ -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; }; }; });