about summary refs log tree commit diff
path: root/tvix/glue/src/derivation.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-11-03T12·08+0200
committerclbot <clbot@tvl.fyi>2023-11-04T15·18+0000
commit619f1fe88d009e228cfd348da12b98f6a4533052 (patch)
tree247be7cb9422198628b8434eb99f64a7aec15997 /tvix/glue/src/derivation.rs
parent3196fe0143b6ff729c177fa5d17fa03c9e9627c9 (diff)
refactor(tvix/glue): use add_derivation_builtins helper r/6937
Change-Id: I284c82612f1c8c81a8b7711fe63c19778ff2fdf0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9909
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/glue/src/derivation.rs')
-rw-r--r--tvix/glue/src/derivation.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/tvix/glue/src/derivation.rs b/tvix/glue/src/derivation.rs
index 86a271a3966d..323bf213c255 100644
--- a/tvix/glue/src/derivation.rs
+++ b/tvix/glue/src/derivation.rs
@@ -468,7 +468,7 @@ pub use derivation_builtins::builtins as derivation_builtins;
 
 #[cfg(test)]
 mod tests {
-    use crate::known_paths::KnownPaths;
+    use crate::{add_derivation_builtins, known_paths::KnownPaths};
     use nix_compat::store_path::hash_placeholder;
     use std::{cell::RefCell, rc::Rc};
     use test_case::test_case;
@@ -482,12 +482,7 @@ mod tests {
 
         let known_paths: Rc<RefCell<KnownPaths>> = Default::default();
 
-        eval.builtins
-            .extend(crate::derivation::derivation_builtins(known_paths));
-
-        // Add the actual `builtins.derivation` from compiled Nix code
-        eval.src_builtins
-            .push(("derivation", include_str!("derivation.nix")));
+        add_derivation_builtins(&mut eval, known_paths.clone());
 
         // run the evaluation itself.
         eval.evaluate()