From 62e91e797d7780ec6283615be482ebdde6f05ebb Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sun, 17 Aug 2025 20:52:54 +0200 Subject: [PATCH] in retrospect, just use `submodule` as the import --- deployment/data-model.nix | 2 +- deployment/function.nix | 51 ++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 88069508..5df56959 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -15,7 +15,7 @@ let functionTo ; - functionType = import ./function.nix { inherit lib; }; + functionType = submodule ./function.nix; application-resources = submodule { options.resources = mkOption { # TODO: maybe transpose, and group the resources by type instead diff --git a/deployment/function.nix b/deployment/function.nix index 21d8aecc..f0210a34 100644 --- a/deployment/function.nix +++ b/deployment/function.nix @@ -1,7 +1,7 @@ /** Modular function type */ -{ lib, ... }: +{ config, lib, ... }: let inherit (lib) mkOption types; inherit (types) @@ -10,30 +10,27 @@ let optionType ; in -submodule ( - { config, ... }: - { - options = { - input-type = mkOption { - type = optionType; - }; - output-type = mkOption { - type = optionType; - }; - function-type = mkOption { - type = optionType; - readOnly = true; - default = functionTo (submodule { - options = { - input = mkOption { - type = config.input-type; - }; - output = mkOption { - type = config.output-type; - }; - }; - }); - }; +{ + options = { + input-type = mkOption { + type = optionType; }; - } -) + output-type = mkOption { + type = optionType; + }; + function-type = mkOption { + type = optionType; + readOnly = true; + default = functionTo (submodule { + options = { + input = mkOption { + type = config.input-type; + }; + output = mkOption { + type = config.output-type; + }; + }; + }); + }; + }; +}