Skip to content

Instantly share code, notes, and snippets.

@cleverca22

cleverca22/Makefile Secret

Created Oct 12, 2019
Embed
What would you like to do?
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "nix-fork";
src = ./.;
buildInputs = [ nix boost ];
}
#include <nix/value.hh>
using namespace nix;
extern "C" void nixFork(EvalState &state, Value &v) {
v.type = tInt;
v.integer = 42;
}
fork.so: fork.cpp
g++ $< -o $@ -shared
test1: fork.so
nix-instantiate --eval test-incremental.nix --allow-unsafe-native-code-during-evaluation
.PHONY: test1
builtins.importNative ./fork.so "nixFork"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.