diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2022-06-10 16:31:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 16:31:31 +0200 |
commit | b37801bc3f9d5adb162516419ac2a9475294a5dd (patch) | |
tree | a70fee412902620d2436eddb00f56be742522a6a /lib/trivial.nix | |
parent | e3243028b5a8d434330dba1f11e8c555663f408b (diff) | |
parent | 4d9801a78fff121703c4ea4dcef8b6746973165c (diff) |
Merge pull request #157480 from MatthewCroughan/in-pure-eval-mode
lib: add inPureEvalMode
Diffstat (limited to 'lib/trivial.nix')
-rw-r--r-- | lib/trivial.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index e4f95234b21a8..ec5dd5a5a5ed8 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -229,6 +229,13 @@ rec { */ inNixShell = builtins.getEnv "IN_NIX_SHELL" != ""; + /* Determine whether the function is being called from inside pure-eval mode + by seeing whether `builtins` contains `currentSystem`. If not, we must be in + pure-eval mode. + + Type: inPureEvalMode :: bool + */ + inPureEvalMode = ! builtins ? currentSystem; ## Integer operations |