From 0399486bc7b383d34ba5c686d8905c477e141dc3 Mon Sep 17 00:00:00 2001 From: Dusk Banks Date: Wed, 19 Apr 2023 01:28:09 +0000 Subject: [PATCH] lib: Update `deferredModuleWith` polyfill (cherry picked from commit 3bbcca6b6f38613f835dbe00d0d5808a001ac38e) --- lib.nix | 5 ++++- modules/perSystem.nix | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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;