about summary refs log tree commit diff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-03-30T12·04-0400
committerShea Levy <shea@shealevy.com>2017-03-30T12·04-0400
commit0bb8db257d98a32abde759f4d07d28b5178bd3bf (patch)
treeea00a7b109da40a2a187f2bda4cde3f92a6d4818 /src/libstore/gc.cc
parentc60715e937e3773bbb8a114fc9b9c6577f8c5cb5 (diff)
Add exec primop behind allow-unsafe-native-code-during-evaluation.
Execute a given program with the (optional) given arguments as the
user running the evaluation, parsing stdout as an expression to be
evaluated.

There are many use cases for nix that would benefit from being able to
run arbitrary code during evaluation, including but not limited to:

* Automatic git fetching to get a sha256 from a git revision
* git rev-parse HEAD
* Automatic extraction of information from build specifications from
  other tools, particularly language-specific package managers like
  cabal or npm
* Secrets decryption (e.g. with nixops)
* Private repository fetching

Ideally, we would add this functionality in a more principled way to
nix, but in the mean time 'builtins.exec' can be used to get these
tasks done.

The primop is only available when the
'allow-unsafe-native-code-during-evaluation' nix option is true. That
flag also enables the 'importNative' primop, which is strictly more
powerful but less convenient (since it requires compiling a plugin
against the running version of nix).
Diffstat (limited to 'src/libstore/gc.cc')
0 files changed, 0 insertions, 0 deletions