#zig-flake: a better Nix flake for building Zig projects

1 messages · Page 1 of 1 (latest)

earnest stream
#

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.makePackage helper that handles all the packaging for you - just update the depsHash whenever you change your build.zig.zon!
  • a setup hook if you want to call stdenv.mkDerivation directly
  • 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

https://github.com/silversquirl/zig-flake

GitHub

Simple Nix flake for Zig. Contribute to silversquirl/zig-flake development by creating an account on GitHub.

swift oyster
#

thanks for making this! already started using it zeroLike

uneven mist
#

Why is compat in another branch and not intergrated into main by default?

earnest stream
#

to avoid cluttering up nix flake show - ideally, most consumers of the flake would use the canonical names, rather than requiring the compat layer

main marsh
earnest stream
main marsh