From 2b0b6f2004d06a73212a40c77ad480155760df22 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 24 Sep 2021 00:18:19 +0200 Subject: [PATCH] lib: modules: document 'mapModules' --- lib/modules.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/modules.nix b/lib/modules.nix index 92e8476..455015b 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -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: