Skip to content

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Jan 18, 2026

Summary

Fix module extension isolation error: nix_repo.github() can only be used in the root module.

Problem

When rules_rocq_rust is used as a dependency, the nix_repo.github() call in its MODULE.bazel fails with:

Illegal use of the github tag. The github tag may only be used on an isolated module extension or in the root module

Solution

Remove the nixpkgs configuration from rules_rocq_rust's MODULE.bazel. Users must configure it in their root MODULE.bazel:

nix_repo = use_extension("@rules_nixpkgs_core//extensions:repository.bzl", "nix_repo")
nix_repo.github(
    name = "nixpkgs",
    org = "NixOS",
    repo = "nixpkgs",
    commit = "d4f247e89f6e10120f911e2e2d2254a050d0f732",
    sha256 = "dee2f93be38d1a63ee9b731fa993f0ac2c60c3a62cca32d4cc64c2ed5b8a8e06",
)
use_repo(nix_repo, "nixpkgs")

Test plan

  • CI passes
  • Test in LOOM with nixpkgs configured in root module

The nix_repo.github() tag can only be used in the root module
or an isolated extension. Update MODULE.bazel to not configure
nixpkgs itself and document that users must configure it.
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

Successfully merging this pull request may close these issues.

2 participants