The nix c bindings have now merged into master, with some small changes since these bindings were created. This commit updates the input, and adjusts it to the new API. (cherry picked from commit aa02380bfcc6221615f65152de60cf4cca3bbbbe)
(cherry picked from commit ac29248e10d6e2364138d11196151a9f445b379d)
(cherry picked from commit bf1ddd1c9137578b86895577d5b80e0c5771b605)