Skip to content

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Jan 18, 2026

Summary

Switch from attempting to download Rocq Platform binaries to using nixpkgs for hermetic Coq installation.

Why nixpkgs?

The Rocq Platform only provides pre-built binaries for:

  • macOS ARM64 (DMG ~1GB)
  • Windows x86_64 (EXE)

No binaries for: Linux (any arch), macOS Intel

nixpkgs provides Coq packages for all platforms:

  • Linux x86_64 ✅
  • Linux aarch64 ✅
  • macOS x86_64 ✅
  • macOS aarch64 ✅

Changes

  • Add rules_nixpkgs_core dependency
  • Configure nixpkgs repository (pinned to nixos-24.11)
  • Create rocq_nix_toolchain.bzl using nixpkgs_package
  • Update extensions to use nix-based toolchain
  • Simplify MODULE.bazel (remove broken extensions)
  • Fix Starlark syntax errors in tool_registry.bzl
  • Rewrite README with nix installation instructions

Breaking Change

Users must install nix for the toolchain to work:

# macOS
sh <(curl -L https://nixos.org/nix/install)

# Linux
sh <(curl -L https://nixos.org/nix/install) --daemon

How it works

  1. First build: Bazel fetches nixpkgs, nix fetches Coq (~5-10 min)
  2. Subsequent builds: Uses cached toolchain (instant)

Test plan

  • Verify bazel query //rocq/... works
  • Test on macOS with nix installed
  • Test on Linux with nix installed

Switch from attempting to download Rocq Platform binaries (which are
only available for macOS ARM64 and Windows) to using nixpkgs for
hermetic Coq installation.

This provides:
- Cross-platform support (Linux x86_64/arm64, macOS x86_64/arm64)
- Hermetic builds via nix
- Multiple Coq versions (8.20, 8.19, 8.18, etc.)

Changes:
- Add rules_nixpkgs_core dependency to MODULE.bazel
- Configure nixpkgs repository with nixos-24.11 stable channel
- Create rocq_nix_toolchain.bzl using nixpkgs_package
- Update extensions.bzl to use nix-based toolchain
- Simplify MODULE.bazel (remove broken OCaml/coq_of_rust extensions)
- Fix tool_registry.bzl and rocq_toolchain.bzl syntax errors
- Add toolchain_type to rocq/BUILD.bazel
- Rewrite README with nix installation instructions

BREAKING CHANGE: Users must install nix for the toolchain to work.
See README.md for installation instructions.
@avrabe avrabe merged commit 56bdc27 into main Jan 18, 2026
6 checks passed
@avrabe avrabe deleted the feat/nix-toolchain branch January 18, 2026 07:18
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