mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
lib.types.deferredModule: Allow path-typed module references
This commit is contained in:
parent
a2c29561e7
commit
781c2e0789
@ -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;
|
||||
}
|
||||
|
||||
{
|
||||
|
3
lib/tests/modules/define-settingsDict-a-is-b.nix
Normal file
3
lib/tests/modules/define-settingsDict-a-is-b.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{ config, ... }: {
|
||||
settingsDict.a = config.settingsDict.b;
|
||||
}
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user