From ea7d63e177d8a951e30bc00918081eb069e2efb2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 13 Dec 2022 20:17:00 +0300 Subject: feat(tvix/cli): implement `NixCompatIO` helper type This type allows for temporarily compatibility with the C++ Nix store, specifically (for now) it gives us the store directory used by Nix and imports files the same way. Change-Id: I4767794ef2863eba49661315c63c4e17de946d60 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7587 Reviewed-by: grfn Tested-by: BuildkiteCI --- tvix/cli/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tvix/cli/src/main.rs') diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 7e6b7520b0..3228489e71 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -1,3 +1,5 @@ +mod nix_compat; + use std::{fs, path::PathBuf}; use clap::Parser; @@ -39,7 +41,7 @@ struct Args { /// evaluation succeeded. fn interpret(code: &str, path: Option, args: &Args) -> bool { let mut eval = tvix_eval::Evaluation::new(code, path); - eval.io_handle = Box::new(tvix_eval::StdIO); + eval.io_handle = Box::new(nix_compat::NixCompatIO::new()); eval.nix_path = args.nix_search_path.clone(); let source_map = eval.source_map(); -- cgit 1.4.1