about summary refs log tree commit diff
path: root/tvix/glue/src/lib.rs
blob: f04d5ec3a0f2bdf0faa3660282a6a6fac56e5348 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pub mod builtins;
pub mod known_paths;
pub mod refscan;
pub mod tvix_build;
pub mod tvix_io;
pub mod tvix_store_io;

mod decompression;
#[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()));
}