From 60d9fba56d12279157e62c6df60b421ec116c8ee Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 9 Dec 2022 13:33:06 +0300 Subject: chore(tvix/cli): re-add NIX_PATH handling Change-Id: I5595d6f5141ed4a533ca44a46264dc604fca6be1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7549 Tested-by: BuildkiteCI Reviewed-by: grfn --- tvix/cli/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tvix/cli/src') diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 5604e1a83fdd..897c31570ac0 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -12,6 +12,10 @@ struct Args { #[clap(long, short = 'E')] expr: Option, + /// A colon-separated list of directories to use to resolve `<...>`-style paths + #[clap(long, short = 'I', env = "NIX_PATH")] + nix_search_path: Option, + /// Print "raw" (unquoted) output. #[clap(long)] raw: bool, @@ -21,7 +25,9 @@ struct Args { /// and the result itself. The return value indicates whether /// evaluation succeeded. fn interpret(code: &str, path: Option, args: &Args) -> bool { - let eval = tvix_eval::Evaluation::new(code, path); + let mut eval = tvix_eval::Evaluation::new(code, path); + eval.nix_path = args.nix_search_path.clone(); + let source_map = eval.source_map(); let result = eval.evaluate(); -- cgit 1.4.1