add findImport
This commit is contained in:
parent
471e1617e8
commit
8725f5079f
2 changed files with 14 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ in
|
|||
submods.prim
|
||||
submods.naive
|
||||
./attrs.nix
|
||||
./nix.nix
|
||||
|
||||
submods
|
||||
]
|
||||
|
|
|
|||
13
nt/precursor/bootstrap/nix.nix
Normal file
13
nt/precursor/bootstrap/nix.nix
Normal 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";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue