Nix overlay and build tools for Lean 4, enabling reproducible builds and dependency management for Lean projects.
Lean 4 Nix is a Nix overlay and set of build tools for the Lean 4 theorem prover. It provides a reproducible way to build Lean 4 and its projects using Nix, replacing the deprecated official Nix flake. The project solves dependency management and build reproducibility for Lean developers working in Nix environments.
Lean 4 developers and researchers who use Nix for package management and need reproducible builds for their Lean projects, libraries, or executables.
Developers choose Lean 4 Nix because it offers flexible Lean version management, automatic dependency handling via lake2nix, incremental builds for faster development, and integration with Nix's caching for efficient builds.
Nix overlay for Lean 4, and lake2nix
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Overlay supports building Lean from toolchain files, Git revisions, or source folders, offering multiple methods as ranked in the README for various use cases.
lake2nix utility automatically converts lake-manifest.json into Nix dependencies, eliminating manual dependency management for Lake projects.
Provides incremental builds for Lake projects via lakeArtifacts configuration, improving development speed by caching intermediate artifacts.
Integrates with Garnix CI for binary caching, speeding up builds when nixpkgs versions match, as detailed in the caching section.
Only supports leanprover/lean4:{tag} toolchains for stable versions; other toolchains require manual handling with readRev or readFromGit, adding complexity.
Multiple overlay options are ranked by difficulty, and users must manually apply overlays and handle bootstrap functions for non-standard versions, which can be confusing.
Requires significant knowledge of Nix flakes, overlays, and derivations, making it inaccessible to developers unfamiliar with Nix's ecosystem.