blob: 7b806117674246530f7e954a5a361863e95cee6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
self: lib: prev: with lib; {
modulesIn = dir: pipe dir [
builtins.readDir
(mapAttrsToList (name: type:
if type == "regular" && hasSuffix ".nix" name && name != "default.nix" then
[ { name = removeSuffix ".nix" name; value = dir + "/${name}"; } ]
else if type == "directory" && pathExists (dir + "/${name}/default.nix") then
[ { inherit name; value = dir + "/${name}"; } ]
else
[]
))
concatLists
listToAttrs
];
# Collects the inputs of a flake recursively (with possible duplicates).
collectFlakeInputs = input:
[ input ] ++ concatMap collectFlakeInputs (builtins.attrValues (input.inputs or {}));
ivi = import ./ivi.nix self lib;
}
|