diff --git a/lib.nix b/lib.nix index 64c35c1..89098cb 100644 --- a/lib.nix +++ b/lib.nix @@ -37,8 +37,11 @@ let attrs@{ staticModules ? [ ] }: mkOptionType { name = "deferredModule"; description = "module"; + descriptionClass = "noun"; check = x: isAttrs x || isFunction x || path.check x; - merge = loc: defs: staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; + merge = loc: defs: { + imports = staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; + }; inherit (submoduleWith { modules = staticModules; }) getSubOptions getSubModules; diff --git a/modules/perSystem.nix b/modules/perSystem.nix index 499858a..4b20e55 100644 --- a/modules/perSystem.nix +++ b/modules/perSystem.nix @@ -119,9 +119,9 @@ in _module.args.moduleWithSystem = throwAliasError "moduleWithSystem"; }; }); - apply = modules: system: + apply = module: system: (lib.evalModules { - inherit modules; + modules = [ module ]; prefix = [ "perSystem" system ]; specialArgs = { inherit system;