1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Add plugins to make Nix more extensible.

All plugins in plugin-files will be dlopened, allowing them to
statically construct instances of the various Register* types Nix
supports.
This commit is contained in:
Shea Levy 2018-02-08 11:26:18 -05:00
parent f201b7733e
commit 88cd2d41ac
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27
24 changed files with 122 additions and 3 deletions

View file

@ -742,6 +742,33 @@ builtins.fetchurl {
</varlistentry>
<varlistentry xml:id="conf-plugin-files">
<term><literal>plugin-files</literal></term>
<listitem>
<para>
A list of plugin files to be loaded by Nix. Each of these
files will be dlopened by Nix, allowing them to affect
execution through static initialization. In particular, these
plugins may construct static instances of RegisterPrimOp to
add new primops to the expression language,
RegisterStoreImplementation to add new store implementations,
and RegisterCommand to add new subcommands to the
<literal>nix</literal> command. See the constructors for those
types for more details.
</para>
<para>
Since these files are loaded into the same address space as
Nix itself, they must be DSOs compatible with the instance of
Nix running at the time (i.e. compiled against the same
headers, not linked to any incompatible libraries). They
should not be linked to any Nix libs directly, as those will
be available already at load time.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>

View file

@ -389,6 +389,13 @@ configureFlags = "--prefix=${placeholder "out"} --includedir=${placeholder "dev"
</para>
</listitem>
<listitem>
<para>
Nix can now be extended with plugins. See the documentation of
the 'plugin-files' option for more details.
</para>
</listitem>
</itemizedlist>
<para>Some features were removed:</para>