Convert Zig package dependencies from build.zig.zon files into Nix expressions for reproducible builds.
zon2nix is a command-line tool that converts dependencies from Zig's `build.zig.zon` manifest files into Nix expressions. It solves the problem of integrating Zig projects into Nix-based build systems by automatically translating Zig package specifications into Nix-compatible fetch operations, enabling reproducible builds.
Zig developers using Nix for package management, and Nix users who need to incorporate Zig projects into their reproducible build pipelines.
Developers choose zon2nix because it provides a seamless bridge between Zig's native package format and Nix's powerful dependency management, eliminating manual conversion work and ensuring hash-verified, deterministic builds.
Convert the dependencies in build.zig.zon to a Nix expression [maintainer=@figsoda]
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Translates Zig package URLs and hashes from build.zig.zon into Nix fetchzip calls automatically, saving manual effort as shown in the example output.
Generates Nix expressions that populate Zig's global cache directory via the postPatch step, ensuring dependencies are available in Nix builds without extra configuration.
Produces content-addressed Nix paths based on dependency hashes, leveraging Nix's reproducibility for consistent builds across environments.
Accepts project names, file paths, or stdin for processing build.zig.zon files, making it adaptable to various workflows as per the usage examples.
Requires users to manually add the postPatch step to their Nix expressions, as documented, which adds complexity beyond automatic dependency management.
The README provides only basic usage with sparse examples, lacking guidance on advanced use cases, error handling, or integration with Nix flakes.
Focuses solely on dependency conversion without addressing full project builds or packaging, leaving users to handle additional Nix configuration for compiling Zig code.