After getting frustrated with the existing options, I've created a new Nix flake for Zig. It provides Nix packages for the official binary builds, as well as helpers for creating Nix packages for your own Zig projects.
A comprehensive comparison with the alternatives can be found in the readme, but here's a summary of zig-flake's unique featureset:
- zero dependencies other than nixpkgs
- a dependency fetcher using the zig package manager, that uses your existing build.zig.zon and only requires updating a single hash when dependencies change
- a simple
zig.makePackagehelper that handles all the packaging for you - just update thedepsHashwhenever you change your build.zig.zon! - a setup hook if you want to call
stdenv.mkDerivationdirectly - drop-in compatibility with zig-overlay (as used by zls, etc)
- frequent update checks - latest zig releases will be available no more than half an hour after they're published on ziglang.org
GitHub
Simple Nix flake for Zig. Contribute to silversquirl/zig-flake development by creating an account on GitHub.
