aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-settings.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval-settings.hh')
-rw-r--r--src/libexpr/eval-settings.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libexpr/eval-settings.hh b/src/libexpr/eval-settings.hh
index 19122bc31..049f42e70 100644
--- a/src/libexpr/eval-settings.hh
+++ b/src/libexpr/eval-settings.hh
@@ -25,6 +25,26 @@ struct EvalSettings : Config
[`builtins.nixPath`](@docroot@/language/builtin-constants.md#builtins-nixPath).
)"};
+ Setting<std::string> currentSystem{
+ this, "", "eval-system",
+ R"(
+ This option defines
+ [`builtins.currentSystem`](@docroot@/language/builtin-constants.md#builtins-currentSystem)
+ in the Nix language if it is set as a non-empty string.
+ Otherwise, if it is defined as the empty string (the default), the value of the
+ [`system` ](#conf-system)
+ configuration setting is used instead.
+
+ Unlike `system`, this setting does not change what kind of derivations can be built locally.
+ This is useful for evaluating Nix code on one system to produce derivations to be built on another type of system.
+ )"};
+
+ /**
+ * Implements the `eval-system` vs `system` defaulting logic
+ * described for `eval-system`.
+ */
+ const std::string & getCurrentSystem();
+
Setting<bool> restrictEval{
this, false, "restrict-eval",
R"(