lix/src/libexpr
Shea Levy 5cd022d6c0 Add importNative primop
This can be used to import a dynamic shared object and return an
arbitrary value, including new primops. This can be used both to test
new primops without having to recompile nix every time, and to build
specialized primops that probably don't belong upstream (e.g. a function
that calls out to gpg to decrypt a nixops secret as-needed).

The imported function should initialize the Value & as needed. A single
import can define multiple values by creating an attrset or list, of
course.

An example initialization function might look like:

extern "C" void initialize(nix::EvalState & state, nix::Value & v)
{
    v.type = nix::tPrimOp;
    v.primOp = NEW nix::PrimOp(myFun, 1, state.symbols.create("myFun"));
}

Then `builtins.importNative ./example.so "initialize"` will evaluate to
the primop defined in the myFun function.
2014-06-17 12:08:01 -04:00
..
attr-path.cc Support quoted attribute names in -A 2013-11-18 10:21:12 +00:00
attr-path.hh Work on Values instead of Exprs 2013-09-03 13:17:51 +00:00
common-opts.cc Make the Nix search path declarative 2014-05-26 17:02:22 +02:00
common-opts.hh Ensure that -I flags get included in nixPath 2014-05-26 16:52:31 +02:00
eval-inline.hh forceAttrs: Show position info 2014-04-04 19:11:40 +02:00
eval.cc == operator: Ignore string context 2014-06-10 14:02:56 +02:00
eval.hh Make the Nix search path declarative 2014-05-26 17:02:22 +02:00
get-drvs.cc Show position info in string concatenation / addition errors 2014-04-04 22:19:33 +02:00
get-drvs.hh Drop pointless #include 2014-03-29 22:20:33 +01:00
lexer.l Allow "bare" dynamic attrs 2014-01-14 14:00:15 +01:00
local.mk Add importNative primop 2014-06-17 12:08:01 -04:00
names.cc nix-env: Use wildcard match by default 2013-09-03 16:35:49 +02:00
names.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
nix.sdf First attempt to update Nix SDF grammar to match the actual bison grammar 2008-06-04 14:36:46 +00:00
nixexpr.cc Remove ExprBuiltin 2014-05-26 17:14:28 +02:00
nixexpr.hh Drop ImportError and FindError 2014-06-12 13:00:54 +02:00
parser.y Remove ExprBuiltin 2014-05-26 17:14:28 +02:00
primops.cc Add importNative primop 2014-06-17 12:08:01 -04:00
symbol-table.hh Use std::unordered_set 2014-05-26 17:53:17 +02:00
value-to-json.cc Refactor JSON output 2013-11-19 00:33:06 +01:00
value-to-json.hh Refactor JSON output 2013-11-19 00:33:06 +01:00
value-to-xml.cc Fix compilation on FreeBSD 2012-03-05 22:04:40 +01:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh Fix some clang warnings 2014-01-21 18:29:55 +01:00