lib: modules: document 'mapModules'

This commit is contained in:
Bruno BELANYI 2021-09-24 00:18:19 +02:00
parent 2d26b36e31
commit bad9b8a06b

View file

@ -5,6 +5,14 @@ let
inherit (self.attrs) mapFilterAttrs;
in
{
# Find all nix modules in a directory, discard any prefixed with "_",
# map a function to each resulting path, and generate an attribute set
# to associate module name to resulting value.
#
# mapModules ::
# path
# (path -> any)
# attrs
mapModules = dir: fn:
mapFilterAttrs
(n: v: