1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Add eval-system option

`eval-system` option overrides just the value of `builtins.currentSystem`.
This is more useful than overriding `system` since you can build these
derivations on remote builders which can work on the given system.

Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
Matthew Bauer 2020-09-29 15:33:47 -04:00 committed by John Ericson
parent fc0accf3dc
commit bcbdb09ccf
5 changed files with 40 additions and 6 deletions

View file

@ -1,6 +1,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "eval-settings.hh"
#include "memory-input-accessor.hh"
#include "tests/libexpr.hh"
@ -631,7 +632,7 @@ namespace nix {
TEST_F(PrimOpTest, currentSystem) {
auto v = eval("builtins.currentSystem");
ASSERT_THAT(v, IsStringEq(settings.thisSystem.get()));
ASSERT_THAT(v, IsStringEq(evalSettings.getCurrentSystem()));
}
TEST_F(PrimOpTest, derivation) {