Merge pull request #157480 from MatthewCroughan/in-pure-eval-mode

lib: add inPureEvalMode
main
Robert Hensing 2 years ago committed by GitHub
commit b37801bc3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/default.nix
  2. 7
      lib/trivial.nix

@ -71,7 +71,7 @@ let
info showWarnings nixpkgsVersion version isInOldestRelease
mod compare splitByAndCompare
functionArgs setFunctionArgs isFunction toFunction
toHexString toBaseDigits;
toHexString toBaseDigits inPureEvalMode;
inherit (self.fixedPoints) fix fix' converge extends composeExtensions
composeManyExtensions makeExtensible makeExtensibleWithCustomName;
inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath

@ -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

Loading…
Cancel
Save