feat: Change nix formatter to alejandra
This commit is contained in:
parent
0b8b647f05
commit
b4c3dfec42
229 changed files with 2528 additions and 2884 deletions
|
|
@ -1,38 +1,39 @@
|
|||
final: _prev: {
|
||||
youthlic = {
|
||||
loadImports' =
|
||||
dir: f:
|
||||
loadImports' = dir: f:
|
||||
final.pipe dir [
|
||||
final.youthlic.loadImports
|
||||
f
|
||||
];
|
||||
loadImports =
|
||||
dir:
|
||||
loadImports = dir:
|
||||
with final;
|
||||
if !(pathExists dir && builtins.readFileType dir == "directory") then
|
||||
[ ]
|
||||
else
|
||||
let
|
||||
if !(pathExists dir && builtins.readFileType dir == "directory")
|
||||
then []
|
||||
else let
|
||||
items = pipe dir [
|
||||
builtins.readDir
|
||||
attrNames
|
||||
];
|
||||
in
|
||||
pipe items [
|
||||
(concatMap (
|
||||
name:
|
||||
let
|
||||
path = dir + "/${name}";
|
||||
type = builtins.readFileType path;
|
||||
in
|
||||
if type == "directory" then
|
||||
if pathExists (path + "/default.nix") then [ path ] else youthlic.loadImports path
|
||||
else if type == "regular" then
|
||||
if hasSuffix ".nix" name then [ path ] else [ ]
|
||||
else
|
||||
[ ]
|
||||
))
|
||||
(filter (name: !hasSuffix "/default.nix" (toString name)))
|
||||
];
|
||||
pipe items [
|
||||
(concatMap (
|
||||
name: let
|
||||
path = dir + "/${name}";
|
||||
type = builtins.readFileType path;
|
||||
in
|
||||
if type == "directory"
|
||||
then
|
||||
if pathExists (path + "/default.nix")
|
||||
then [path]
|
||||
else youthlic.loadImports path
|
||||
else if type == "regular"
|
||||
then
|
||||
if hasSuffix ".nix" name
|
||||
then [path]
|
||||
else []
|
||||
else []
|
||||
))
|
||||
(filter (name: !hasSuffix "/default.nix" (toString name)))
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue