lib/modules.nix: Format
This commit is contained in:
parent
4dd51a9ace
commit
8f700580b9
@ -541,8 +541,10 @@ let
|
|||||||
let
|
let
|
||||||
# an attrset 'name' => list of submodules that declare ‘name’.
|
# an attrset 'name' => list of submodules that declare ‘name’.
|
||||||
declsByName =
|
declsByName =
|
||||||
zipAttrsWith (n: concatLists)
|
zipAttrsWith
|
||||||
(map (module: let subtree = module.options; in
|
(n: concatLists)
|
||||||
|
(map
|
||||||
|
(module: let subtree = module.options; in
|
||||||
if !(builtins.isAttrs subtree) then
|
if !(builtins.isAttrs subtree) then
|
||||||
throw ''
|
throw ''
|
||||||
An option declaration for `${builtins.concatStringsSep "." prefix}' has type
|
An option declaration for `${builtins.concatStringsSep "." prefix}' has type
|
||||||
@ -555,7 +557,8 @@ let
|
|||||||
[{ inherit (module) _file; options = option; }]
|
[{ inherit (module) _file; options = option; }]
|
||||||
)
|
)
|
||||||
subtree
|
subtree
|
||||||
) options);
|
)
|
||||||
|
options);
|
||||||
|
|
||||||
# The root of any module definition must be an attrset.
|
# The root of any module definition must be an attrset.
|
||||||
checkedConfigs =
|
checkedConfigs =
|
||||||
@ -577,24 +580,30 @@ let
|
|||||||
|
|
||||||
# an attrset 'name' => list of submodules that define ‘name’.
|
# an attrset 'name' => list of submodules that define ‘name’.
|
||||||
pushedDownDefinitionsByName =
|
pushedDownDefinitionsByName =
|
||||||
zipAttrsWith (n: concatLists)
|
zipAttrsWith
|
||||||
(map (module:
|
(n: concatLists)
|
||||||
|
(map
|
||||||
|
(module:
|
||||||
mapAttrs
|
mapAttrs
|
||||||
(n: value:
|
(n: value:
|
||||||
map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
|
map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
|
||||||
)
|
)
|
||||||
module.config
|
module.config
|
||||||
) checkedConfigs);
|
)
|
||||||
|
checkedConfigs);
|
||||||
# extract the definitions for each loc
|
# extract the definitions for each loc
|
||||||
rawDefinitionsByName =
|
rawDefinitionsByName =
|
||||||
zipAttrsWith (n: concatLists)
|
zipAttrsWith
|
||||||
(map (module:
|
(n: concatLists)
|
||||||
|
(map
|
||||||
|
(module:
|
||||||
mapAttrs
|
mapAttrs
|
||||||
(n: value:
|
(n: value:
|
||||||
[{ inherit (module) file; inherit value; }]
|
[{ inherit (module) file; inherit value; }]
|
||||||
)
|
)
|
||||||
module.config
|
module.config
|
||||||
) checkedConfigs);
|
)
|
||||||
|
checkedConfigs);
|
||||||
|
|
||||||
# Convert an option tree decl to a submodule option decl
|
# Convert an option tree decl to a submodule option decl
|
||||||
optionTreeToOption = decl:
|
optionTreeToOption = decl:
|
||||||
|
Loading…
Reference in New Issue
Block a user