WIP: feat: Namespaced includes #3
|
@ -206,7 +206,7 @@ lib: {
|
|||
in
|
||||
builtins.foldl' filter [ ] flattened;
|
||||
austreelis marked this conversation as resolved
|
||||
|
||||
doNamespace =
|
||||
createNamespacedModule =
|
||||
{ namespace, include }:
|
||||
if namespace == null then
|
||||
include
|
||||
|
@ -221,16 +221,17 @@ lib: {
|
|||
description = "include ${namespace}";
|
||||
};
|
||||
austreelis marked this conversation as resolved
jakehamilton
commented
Is this comment needed? Is this comment needed?
austreelis
commented
No, I thought I left it out when cleaning up my patch. No, I thought I left it out when cleaning up my patch.
|
||||
};
|
||||
# config.${namespace} = lib.modules.override 1000 {};
|
||||
};
|
||||
|
||||
austreelis marked this conversation as resolved
jakehamilton
commented
Can we extract the Can we extract the `builtins.map doNamespace flattened` bit to a variable so that this value is easier to read? Something like `builtins.seq throwOnConflict namespacedModules` might make it easier to understand.
|
||||
namespacedModules = builtins.map createNamespacedModule flattened;
|
||||
in
|
||||
builtins.seq throwOnConflict builtins.map doNamespace flattened;
|
||||
builtins.seq throwOnConflict namespacedModules;
|
||||
in
|
||||
if lib.modules.validate.keys module then
|
||||
{
|
||||
austreelis marked this conversation as resolved
jakehamilton
commented
Can we wrap usage of Can we wrap usage of `or` in parens here? It can be a bit confusing otherwise.
|
||||
inherit __key__;
|
||||
__file__ = builtins.toString module.__file__ or file;
|
||||
includes = normalizeIncludes module.includes or [ ];
|
||||
__file__ = builtins.toString (module.__file__ or file);
|
||||
includes = normalizeIncludes (module.includes or [ ]);
|
||||
excludes = module.excludes or [ ];
|
||||
options = module.options or { };
|
||||
config =
|
||||
|
|
Loading…
Reference in a new issue
nit: maybe a name like
createNamespacedModule
would be informative here?