Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide dedicated tutorial for the rules_nixpkgs setup #41

Open
GuillaumeGen opened this issue Oct 20, 2022 · 3 comments
Open

Provide dedicated tutorial for the rules_nixpkgs setup #41

GuillaumeGen opened this issue Oct 20, 2022 · 3 comments

Comments

@GuillaumeGen
Copy link
Contributor

This is a Bazel tutorial, where Bazel is installed with Nix, but one could do exactly the same tutorial and install Bazel natively, it would work exactly the same.
The advantages of using Nix is hidden in the WORKSPACE file, where all the programming languages dependencies that we are dealing with are installed using Nix. But this is completely hidden to the reader of this tutorial. (And it is not a bug that it is hidden, I mean, there could be another tutorial focusing on it, but it should definitely not be mixed with this one).

@GuillaumeGen GuillaumeGen changed the title Does this really is Nix+Bazel Does this really is Nix+Bazel? Oct 20, 2022
@aherrmann
Copy link
Member

Indeed, this tutorial focuses on the Bazel aspect and only uses Nix to setup the project in a hermetic way. It can still function as an example project, after all the setup of all the toolchains with Nix in WORKSPACE could be reused by another project.

rules_nixpkgs should have a user-guide. Once that exists this codelab should link to it.

Do you think that outside of that this codelab should include exercises touching on rules_nixpkgs as well? E.g. letting the reader import a toolchain in the WORKSPACE file?

@GuillaumeGen
Copy link
Contributor Author

My feeling is that it is a good tutorial, but not the one I expected when seeing the title.

@aherrmann aherrmann changed the title Does this really is Nix+Bazel? Provide dedicated tutorial for the rules_nixpkgs setup Nov 10, 2022
@aherrmann
Copy link
Member

Right, the first sentence in the README tries to clarify that

This set of exercises is a practical introduction to building polyglot projects with Bazel, supported by Nix for reproducible, hermetic build environments.

I.e. it's a bazel codelab for a nix+bazel project setup.

As you say we probably don't want to overload the reader by having them set up all the nixpkgs toolchain imports here as well. Messing with the WORKSPACE is usually more advanced than configuring BUILD files, so, it makes sense to first guide the reader through the BUILD files. Perhaps we could add a last exercise that adds some nixpkgs_packages tool or library dependency and uses that in some way to at least introduce simple interaction with rules_nixpkgs directly here. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants