rules_nixpkgs
rules_nixpkgs copied to clipboard
Create a nix module for toolchains
When trying to use a customized toolchain it is non-obvious what rules_nixpkgs' internal requirements are regarding the attributes of the evaluated nix expr (ie. that we require a isClang attribute for a CC toolchain).
I think the nicest option would be to create toolchain modules (I think one can call pkg.lib.evalModules with an options definition and the custom expr?). This is self documenting and can easily provide defaults + more options (like cxx_opts #218). The downside is that it may take a bit of work, and for consistency, should be replicated for the other toolchains.
Originally posted by @dmadisetti in https://github.com/tweag/rules_nixpkgs/issues/216#issuecomment-1160538783