A Nix flake for packaging, building, and running Zig projects with dependency management and cross-compilation.
zig2nix is a Nix flake that provides tooling for packaging, building, and running Zig projects within the Nix ecosystem. It solves the problem of managing Zig dependencies and build environments reproducibly by bridging Zig's native tooling with Nix's package management. It handles tasks like converting Zig dependency files to Nix derivations, providing versioned Zig compilers, and enabling cross-compilation.
Zig developers who use or want to use Nix for reproducible builds and dependency management, especially those working on cross-platform projects or needing precise control over their build environment.
Developers choose zig2nix because it seamlessly integrates Zig with Nix's powerful reproducible build system, eliminating dependency hell and ensuring consistent builds across different machines. Its unique selling point is providing a full suite of Zig-specific tooling (like zon file conversion and multi-version support) as a native Nix flake.
Flake for packaging, building and running Zig projects.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides easy access to specific Zig versions like master, latest, and historical releases, as shown in run commands for different versions.
Offers helpers like pkgsForTarget and crossPkgsForTarget that use Nix's system abstractions to simplify building for different platforms.
Converts Zig's zon files to locked Nix derivations via zon2nix, ensuring consistent builds across environments, as detailed in the conversion examples.
Generates Nix development shells with pre-configured Zig versions and tooling, streamlining setup for isolated environments.
The README is labeled as 'crude documentation', lacking detailed guides and examples, which can hinder onboarding and advanced usage.
Components like zigCrossPkgsForTarget are marked experimental with warnings, indicating potential instability and breaking changes.
Requires proficiency with Nix flakes and the Nix language, posing a significant learning curve for developers new to the ecosystem.