about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 509297003f6e..6876b2853add 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1143,6 +1143,16 @@ void EvalState::createBaseEnv()
     mkString(v, settings.thisSystem.c_str());
     addConstant("__currentSystem", v);
 
+    mkString(v, nixVersion.c_str());
+    addConstant("__nixVersion", v);
+
+    /* Language version.  This should be increased every time a new
+       language feature gets added.  It's not necessary to increase it
+       when primops get added, because you can just use `builtins ?
+       primOp' to check. */
+    mkInt(v, 1);
+    addConstant("__langVersion", v);
+
     // Miscellaneous
     addPrimOp("import", 1, prim_import);
     addPrimOp("isNull", 1, prim_isNull);