lib: modules: document 'mapModules'

This commit is contained in:
Bruno BELANYI 2021-09-24 00:18:19 +02:00
parent 8852699c9a
commit 2b0b6f2004

View file

@ -5,6 +5,14 @@ let
inherit (self.attrs) mapFilterAttrs; inherit (self.attrs) mapFilterAttrs;
in 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: mapModules = dir: fn:
mapFilterAttrs mapFilterAttrs
(n: v: (n: v: