mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-28 16:46:16 +02:00
C API: Apply documentation suggestions
Co-authored-by: asymmetric <lorenzo@mailbox.org>
This commit is contained in:
parent
ac3a9c6605
commit
92dacec0e4
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Getting started
|
# Getting started
|
||||||
|
|
||||||
These C bindings are **experimental** at the moment, which means they can still change any time or get removed again, but the plan is to provide a stable external C API to the Nix language and the Nix store.
|
> **Warning**
|
||||||
|
> These bindings are **experimental**, which means they can change at any time or be removed outright; nevertheless the plan is to provide a stable external C API to the Nix language and the Nix store.
|
||||||
|
|
||||||
The language library allows evaluating Nix expressions and interacting with Nix language values.
|
The language library allows evaluating Nix expressions and interacting with Nix language values.
|
||||||
The Nix store API is still rudimentary, and only allows initialising and connecting to a store for the Nix language evaluator to interact with.
|
The Nix store API is still rudimentary, and only allows initialising and connecting to a store for the Nix language evaluator to interact with.
|
||||||
|
@ -49,7 +50,7 @@ int main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
```
|
```ShellSession
|
||||||
$ gcc main.c $(pkg-config nix-expr-c --libs --cflags) -o main
|
$ gcc main.c $(pkg-config nix-expr-c --libs --cflags) -o main
|
||||||
$ ./main
|
$ ./main
|
||||||
Nix version: 2.17
|
Nix version: 2.17
|
||||||
|
@ -84,7 +85,7 @@ void nix_plugin_entry() {
|
||||||
```
|
```
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
```
|
```ShellSession
|
||||||
$ gcc plugin.c $(pkg-config nix-expr-c --libs --cflags) -shared -o plugin.so
|
$ gcc plugin.c $(pkg-config nix-expr-c --libs --cflags) -shared -o plugin.so
|
||||||
$ nix --plugin-files ./plugin.so repl
|
$ nix --plugin-files ./plugin.so repl
|
||||||
nix-repl> builtins.increment 1
|
nix-repl> builtins.increment 1
|
||||||
|
|
Loading…
Reference in a new issue