resort findImport

This commit is contained in:
do butterflies cry? 2026-02-13 19:30:56 +10:00
parent 8725f5079f
commit f42dcdd49a

View file

@ -4,10 +4,13 @@
pathExists
;
in {
findImport = path:
if pathExists path
then path
else if pathExists (path + "default.nix")
then path + "/default.nix"
else path + ".nix";
findImport = path: let
pathA = path + "/default.nix";
pathB = path + ".nix";
in
if pathExists pathA
then pathA
else if pathExists pathB
then pathB
else path;
}