From 71bc768dc18efa6f4f8f7369bbcf8cffcfd30c33 Mon Sep 17 00:00:00 2001 From: Austreelis Date: Sat, 22 Jun 2024 11:40:22 +0200 Subject: [PATCH] Code cleanup and readability --- lib/src/modules/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/src/modules/default.nix b/lib/src/modules/default.nix index 286564b..487424b 100644 --- a/lib/src/modules/default.nix +++ b/lib/src/modules/default.nix @@ -206,7 +206,7 @@ lib: { in builtins.foldl' filter [ ] flattened; - doNamespace = + createNamespacedModule = { namespace, include }: if namespace == null then include @@ -221,16 +221,17 @@ lib: { description = "include ${namespace}"; }; }; - # config.${namespace} = lib.modules.override 1000 {}; }; + + 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 { 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 =