aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 07:21:01 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 07:21:01 +0100
commit7614aa97975f3e6e36b6ffbd9fec34462021ab39 (patch)
treeebb2521607d7b5a30fadcc13e0af889159d5af2e /src/libexpr/primops.cc
parent64a269ef73b111d49037812bd899b5cb883158ef (diff)
Merge pull request #4093 from matthewbauer/eval-system
Add eval-system option (cherry picked from commit 071dbbee33af9f27338c3e53e4ea067dbfa14010) Change-Id: Ia81358c8cfb60241da07a4d0e84b9ee62a18a53f
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index b906e7747..005a38319 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -4288,13 +4288,16 @@ void EvalState::createBaseEnv()
.impureOnly = true,
});
- if (!evalSettings.pureEval) {
- v.mkString(settings.thisSystem.get());
- }
+ if (!evalSettings.pureEval)
+ v.mkString(evalSettings.getCurrentSystem());
addConstant("__currentSystem", v, {
.type = nString,
.doc = R"(
- The value of the [`system` configuration option](@docroot@/command-ref/conf-file.md#conf-pure-eval).
+ The value of the
+ [`eval-system`](@docroot@/command-ref/conf-file.md#conf-eval-system)
+ or else
+ [`system`](@docroot@/command-ref/conf-file.md#conf-system)
+ configuration option.
It can be used to set the `system` attribute for [`builtins.derivation`](@docroot@/language/derivations.md) such that the resulting derivation can be built on the same system that evaluates the Nix expression: