add findImport

This commit is contained in:
do butterflies cry? 2026-02-13 12:40:36 +10:00
parent 471e1617e8
commit 8725f5079f
2 changed files with 14 additions and 0 deletions

View file

@ -43,6 +43,7 @@ in
submods.prim
submods.naive
./attrs.nix
./nix.nix
submods
]

View file

@ -0,0 +1,13 @@
{...}: let
inherit
(builtins)
pathExists
;
in {
findImport = path:
if pathExists path
then path
else if pathExists (path + "default.nix")
then path + "/default.nix"
else path + ".nix";
}