about summary refs log tree commit diff
path: root/tvix/glue/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/glue/src/lib.rs')
-rw-r--r--tvix/glue/src/lib.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tvix/glue/src/lib.rs b/tvix/glue/src/lib.rs
new file mode 100644
index 000000000000..2e5a3be103a1
--- /dev/null
+++ b/tvix/glue/src/lib.rs
@@ -0,0 +1,23 @@
+pub mod builtins;
+pub mod fetchers;
+pub mod known_paths;
+pub mod refscan;
+pub mod tvix_build;
+pub mod tvix_io;
+pub mod tvix_store_io;
+
+#[cfg(test)]
+mod tests;
+
+/// Tell the Evaluator to resolve `<nix>` to the path `/__corepkgs__`,
+/// which has special handling in [tvix_io::TvixIO].
+/// This is used in nixpkgs to import `fetchurl.nix` from `<nix>`.
+pub fn configure_nix_path<IO>(
+    eval: &mut tvix_eval::Evaluation<IO>,
+    nix_search_path: &Option<String>,
+) {
+    eval.nix_path = nix_search_path
+        .as_ref()
+        .map(|p| format!("nix=/__corepkgs__:{}", p))
+        .or_else(|| Some("nix=/__corepkgs__".to_string()));
+}