about summary refs log tree commit diff
path: root/tvix/eval/src/builtins/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r--tvix/eval/src/builtins/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 2209edd962ae..25d00070e936 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -663,6 +663,8 @@ fn placeholders() -> Vec<Builtin> {
         },
     )]
 }
+// we set TVIX_CURRENT_SYSTEM in build.rs
+pub const CURRENT_PLATFORM: &str = env!("TVIX_CURRENT_SYSTEM");
 
 fn builtins_set() -> NixAttrs {
     let mut map: BTreeMap<NixString, Value> = BTreeMap::new();
@@ -673,6 +675,11 @@ fn builtins_set() -> NixAttrs {
         Value::String("2.3-compat-tvix-0.1".into()),
     );
 
+    map.insert(
+        "currentSystem".into(),
+        crate::systems::llvm_triple_to_nix_double(CURRENT_PLATFORM).into(),
+    );
+
     let mut add_builtins = |builtins: Vec<Builtin>| {
         for builtin in builtins {
             map.insert(builtin.name().into(), Value::Builtin(builtin));