Add extra function for lib, and refactor with loadImports
This commit is contained in:
parent
317a2b4a28
commit
2c997cddce
28 changed files with 111 additions and 204 deletions
17
lib/default.nix
Normal file
17
lib/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
final: _prev: {
|
||||
youthlic = {
|
||||
loadImports' = dir: f:
|
||||
if (builtins.pathExists dir && (builtins.readFileType dir) == "directory")
|
||||
then
|
||||
with final;
|
||||
pipe dir [
|
||||
builtins.readDir
|
||||
attrNames
|
||||
(filter (name: name != "default.nix"))
|
||||
f
|
||||
(map (name: dir + "/${name}"))
|
||||
]
|
||||
else [];
|
||||
loadImports = with final; flip youthlic.loadImports' (x: x);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue