This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
stdenv.mkDerivation { | |
name = "nix-fork"; | |
src = ./.; | |
buildInputs = [ nix boost ]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <nix/value.hh> | |
using namespace nix; | |
extern "C" void nixFork(EvalState &state, Value &v) { | |
v.type = tInt; | |
v.integer = 42; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fork.so: fork.cpp | |
g++ $< -o $@ -shared | |
test1: fork.so | |
nix-instantiate --eval test-incremental.nix --allow-unsafe-native-code-during-evaluation | |
.PHONY: test1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builtins.importNative ./fork.so "nixFork" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment