devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Create a `rules_devbox` for Bazel

Open aaomidi opened this issue 1 year ago • 4 comments

What problem are you trying to solve?

When in a bazel environment, you're usually in an execution sandbox. This sandbox does not have access to the various packages on your system level path, and only packages that are specifically loaded into Bazel.

What solution would you like?

I already use devbox. It would be really nice if devbox provided a devbox_rules Bazel package that looked at my devbox.lock file and made those packages available inside the bazel environment.

Alternatives you've considered

https://github.com/tweag/rules_nixpkgs

aaomidi avatar Sep 12 '24 16:09 aaomidi

I think this is a really cool feature request, but I'm not too familiar with how Bazel Rules work. I can do some research, but if anyone has thoughts on how to set these up with Bazel we'd greatly appreciate the help!

Lagoja avatar Sep 12 '24 21:09 Lagoja

@Lagoja I'm currently in the process of talking to a few folks about writing something for this. I'll probably use the same license as what devbox uses, so we can think about moving it under jetify in the future?

aaomidi avatar Sep 13 '24 14:09 aaomidi

Absolutely! Let me know how we can help

Lagoja avatar Sep 13 '24 22:09 Lagoja

A proof of concept is now available here: https://github.com/aaomidi/rules_devbox.

This only supports the most basic use case of devbox, where you're just relying on a package directly from nixpkgs. Future use cases I'll build out as requests for it come my way.

aaomidi avatar Oct 05 '24 20:10 aaomidi