lib.types: Add deferredModuleWith

This commit is contained in:
Robert Hensing 2022-05-25 17:45:28 +02:00
parent 781c2e0789
commit 19a069ab8b
2 changed files with 25 additions and 3 deletions

View file

@ -467,7 +467,9 @@ rec {
disabledModules = m.disabledModules or [];
imports = m.require or [] ++ m.imports or [];
options = {};
config = addFreeformType (addMeta (removeAttrs m ["_file" "key" "disabledModules" "require" "imports" "freeformType"]));
config =
lib.throwIfNot (isAttrs m) "module ${file} (${key}) does not look like a module."
addFreeformType (addMeta (removeAttrs m ["_file" "key" "disabledModules" "require" "imports" "freeformType"]));
};
applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then