From 421d7b6f93ef1cf29bf0e4642030e4c3c60102a8 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Thu, 24 Jul 2025 18:59:19 +0200 Subject: [PATCH] generalize function type to take types --- deployment/data-model-test.nix | 5 +++-- deployment/data-model.nix | 4 ++-- deployment/function.nix | 9 ++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index 5238ab89..24c31dd8 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -164,7 +164,8 @@ in { inherit (fediversity) example-deployment; }; - expected = { - }; + expected = + { + }; }; } diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 254c041d..70f535ff 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -17,7 +17,7 @@ let ; functionType = import ./function.nix; - application-resources = { + application-resources = submodule { options.resources = mkOption { # TODO: maybe transpose, and group the resources by type instead type = attrsOf ( @@ -25,7 +25,7 @@ let ); }; }; - nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default; + nixops4Deployment = submodule inputs.nixops4.modules.nixops4Deployment.default; in { options = { diff --git a/deployment/function.nix b/deployment/function.nix index 4f473107..5067505c 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; @@ -26,10 +25,10 @@ in submodule (function: { options = { input = mkOption { - type = submodule config.input-type; + type = config.input-type; }; output = mkOption { - type = submodule config.output-type; + type = config.output-type; }; }; })