1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
lib,
inputs,
...
}:
(
let
# read the current directorys files and pipe the result through a list of functions
selfLib = lib.pipe (builtins.readDir ./.) [
# convert to a list containing just the attribute names
(builtins.attrNames)
# drop "default.nix" from the list
(builtins.filter (name: name != "default.nix"))
# convert each list-element containing its file-name to an element containing the file's content
(builtins.map (
name:
import ./${name} {
inherit inputs lib selfLib;
}
))
# merge list of attribute sets together
(lib.mergeAttrsList)
];
in
selfLib
)