mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
docs: mention importNative/exec in allow-unsafe-native-code-during-evaluation (#10803)
* docs: mention importNative/exec in allow-unsafe-native-code-during-evaluation Both of these still needs their own actual documentation, but they are at least now mentioned that they exist and what they're enabled by. Co-authored-by: Qyriad <qyriad@qyriad.me> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
parent
2bd66922ee
commit
5786e1ae7c
1 changed files with 18 additions and 2 deletions
|
@ -15,8 +15,24 @@ struct EvalSettings : Config
|
||||||
|
|
||||||
static std::string resolvePseudoUrl(std::string_view url);
|
static std::string resolvePseudoUrl(std::string_view url);
|
||||||
|
|
||||||
Setting<bool> enableNativeCode{this, false, "allow-unsafe-native-code-during-evaluation",
|
Setting<bool> enableNativeCode{this, false, "allow-unsafe-native-code-during-evaluation", R"(
|
||||||
"Whether builtin functions that allow executing native code should be enabled."};
|
Enable built-in functions that allow executing native code.
|
||||||
|
|
||||||
|
In particular, this adds:
|
||||||
|
- `builtins.importNative` *path*
|
||||||
|
|
||||||
|
Load a dynamic shared object (DSO) at *path* which exposes a function pointer to a procedure that initialises a Nix language value, and return that value.
|
||||||
|
The procedure must have the following signature:
|
||||||
|
```cpp
|
||||||
|
extern "C" typedef void (*ValueInitialiser) (EvalState & state, Value & v);
|
||||||
|
```
|
||||||
|
|
||||||
|
The [Nix C++ API documentation](@docroot@/contributing/documentation.md#api-documentation) has more details on evaluator internals.
|
||||||
|
|
||||||
|
- `builtins.exec` *arguments*
|
||||||
|
|
||||||
|
Execute a program, where *arguments* are specified as a list of strings, and parse its output as a Nix expression.
|
||||||
|
)"};
|
||||||
|
|
||||||
Setting<Strings> nixPath{
|
Setting<Strings> nixPath{
|
||||||
this, getDefaultNixPath(), "nix-path",
|
this, getDefaultNixPath(), "nix-path",
|
||||||
|
|
Loading…
Reference in a new issue