about summary refs log tree commit diff
path: root/tvix/cli/src/main.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-11-03T12·03+0200
committerclbot <clbot@tvl.fyi>2023-11-04T15·18+0000
commita72a1044c29ce41973e0cf81bcee04923f21995f (patch)
treefd4025cafbbc0e55d8c3256eff599f98ff543dbb /tvix/cli/src/main.rs
parent619f1fe88d009e228cfd348da12b98f6a4533052 (diff)
refactor(tvix/glue): move nix_path handling to helper in tvix-glue r/6938
Change-Id: I2327560c4cf0d3f90e253e3c2f47cb29c762461e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9910
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/cli/src/main.rs')
-rw-r--r--tvix/cli/src/main.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs
index 1ffa2be256..66705e1307 100644
--- a/tvix/cli/src/main.rs
+++ b/tvix/cli/src/main.rs
@@ -2,8 +2,8 @@ use std::cell::RefCell;
 use std::rc::Rc;
 use std::sync::Arc;
 use std::{fs, path::PathBuf};
-use tvix_glue::add_derivation_builtins;
 use tvix_glue::known_paths::KnownPaths;
+use tvix_glue::{add_derivation_builtins, configure_nix_path};
 
 use clap::Parser;
 use rustyline::{error::ReadlineError, Editor};
@@ -75,6 +75,7 @@ fn interpret(code: &str, path: Option<PathBuf>, args: &Args, explain: bool) -> b
 
     let known_paths: Rc<RefCell<KnownPaths>> = Default::default();
     add_derivation_builtins(&mut eval, known_paths.clone());
+    configure_nix_path(&mut eval, &args.nix_search_path);
 
     let tokio_runtime = tokio::runtime::Runtime::new().unwrap();
     eval.io_handle = Box::new(tvix_glue::tvix_io::TvixIO::new(
@@ -87,14 +88,6 @@ fn interpret(code: &str, path: Option<PathBuf>, args: &Args, explain: bool) -> b
         ),
     ));
 
-    // bundle fetchurl.nix (used in nixpkgs) by resolving <nix> to
-    // `/__corepkgs__`, which has special handling in [`nix_compat`].
-    eval.nix_path = args
-        .nix_search_path
-        .as_ref()
-        .map(|p| format!("nix=/__corepkgs__:{}", p))
-        .or_else(|| Some("nix=/__corepkgs__".to_string()));
-
     let source_map = eval.source_map();
     let result = {
         let mut compiler_observer =