Simplify modulesTree definition
- Streamlined the construction of modulesTree by consolidating filter logic into a single line for improved readability and maintainability.
This commit is contained in:
@@ -212,17 +212,11 @@
|
|||||||
# https://import-tree.oeiuwq.com/guides/filtering/ ). filterNot composes AND with that.
|
# https://import-tree.oeiuwq.com/guides/filtering/ ). filterNot composes AND with that.
|
||||||
# Skip /package/ and /packages/ (callPackage colocation).
|
# Skip /package/ and /packages/ (callPackage colocation).
|
||||||
# Avoid a global "/home-manager/" filter — it would drop modules/ssh/home-manager/.
|
# Avoid a global "/home-manager/" filter — it would drop modules/ssh/home-manager/.
|
||||||
modulesTree =
|
modulesTree = lib.pipe inputs.import-tree [
|
||||||
lib.pipe inputs.import-tree [
|
(it: it.withLib lib)
|
||||||
(it: it.withLib lib)
|
(it: it.filterNot (p: lib.hasInfix "/package/" p || lib.hasInfix "/packages/" p))
|
||||||
(it:
|
(it: it ./modules)
|
||||||
it.filterNot (
|
];
|
||||||
p:
|
|
||||||
lib.hasInfix "/package/" p
|
|
||||||
|| lib.hasInfix "/packages/" p
|
|
||||||
))
|
|
||||||
(it: it ./modules)
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } modulesTree;
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } modulesTree;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user