From 8725f5079f8f27b3faafeff90e5fc075d55e7d0a Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Fri, 13 Feb 2026 12:40:36 +1000 Subject: [PATCH] add findImport --- nt/precursor/bootstrap/default.nix | 1 + nt/precursor/bootstrap/nix.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 nt/precursor/bootstrap/nix.nix diff --git a/nt/precursor/bootstrap/default.nix b/nt/precursor/bootstrap/default.nix index c044d28..b6e5900 100644 --- a/nt/precursor/bootstrap/default.nix +++ b/nt/precursor/bootstrap/default.nix @@ -43,6 +43,7 @@ in submods.prim submods.naive ./attrs.nix + ./nix.nix submods ] diff --git a/nt/precursor/bootstrap/nix.nix b/nt/precursor/bootstrap/nix.nix new file mode 100644 index 0000000..e8e9319 --- /dev/null +++ b/nt/precursor/bootstrap/nix.nix @@ -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"; +}