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