Advice wanted: writing a build system in Nix

Hey! I’m from Tweag and am currently contracting for a client who created a C build system within Nix, pretty much exactly what you’re looking for, and they are interested in upstreaming it into nixpkgs. The work is in a short pause for now as we’re focusing on some other bits, but I can say that the prototype is working well, isn’t hugely complicated and I expect to be able to PR it to nixpkgs within a couple months!

The main downside is that evaluation is slow, since each C file needs to be its own derivation. This makes it infeasible to be used for packages in nixpkgs itself, but for just a couple packages in development outside of nixpkgs it’s gonna be fine.

Thanks a lot for reaching out on Discourse with this idea, it’s really good to know that other people are interested in this! For now my advice is to wait with spending time on this and stay tuned for the PR we expect to create soonish. I’ll definitely ping you for that, and we might also be able to publish a sneak peak beforehand :slight_smile:

10 Likes