Skip to content

Instantly share code, notes, and snippets.


cleverca22/Makefile Secret

Created Oct 12, 2019
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.cpp
g++ $< -o $@ -shared
nix-instantiate --eval test-incremental.nix --allow-unsafe-native-code-during-evaluation
.PHONY: test1
builtins.importNative ./ "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.