lib.types.deferredModule: Allow path-typed module references

This commit is contained in:
Robert Hensing 2022-05-19 16:31:47 +02:00
parent a2c29561e7
commit 781c2e0789
3 changed files with 5 additions and 4 deletions

View File

@ -34,9 +34,7 @@ in
{
_file = "default-a-is-b.nix";
default = { config, ... }: {
settingsDict.a = config.settingsDict.b;
};
default = ./define-settingsDict-a-is-b.nix;
}
{

View File

@ -0,0 +1,3 @@
{ config, ... }: {
settingsDict.a = config.settingsDict.b;
}

View File

@ -543,7 +543,7 @@ rec {
deferredModule = mkOptionType {
name = "deferredModule";
description = "module";
check = t: isAttrs t || isFunction t;
check = x: isAttrs x || isFunction x || path.check x;
merge = loc: defs: map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs;
};