chore: Use nixfmt reformat all nix source code

This commit is contained in:
ulic-youthlic 2026-07-04 23:11:21 +08:00
parent 1cdf00cefe
commit 11337b8f9e
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
184 changed files with 2349 additions and 1943 deletions

View file

@ -1,39 +1,38 @@
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)))
];
};
}