# As our modules have nonstandard properties, we need to have some way of
# properly intepreting them
# This function takes a list of modules, as well as arguments to import them
# with, and returns a list of modules, each with the standard NixOS module
# properties as well as with custom properties as described in /README.md
modules: args: let
  resolver = module: let
    importedModule =
      if builtins.typeOf module == "path"
      then import module
      else module;
    resolvedModule =
      if builtins.typeOf importedModule == "lambda"
      then
        resolvedModule
        args
      else resolvedModule;
  in {
    home = module.home or {};
    module = {
        module.config or {};
        module.imports or {};
        module.options or {};
    };
  };
in (
  if modules.typeOf == "list"
  then builtins.map resolver modules
  else (resolver modules)
)
