An SMTP client and server library for Zig implementing RFC 5321.
0

Configure Feed

Select the types of activity you want to include in your feed.

Materialize Zig dependencies from nix in the docs workflow

The first workflow run failed because zig build docs tried to fetch
the tls.zig dependency from GitHub on the runner and its TLS setup
failed (TlsInitializationFailed). The zig-pkg directory derivation is
now factored out of package.nix into nix/zig-deps.nix, exposed as
packages.zig-pkg, and the workflow copies it into the checkout before
building so zig never touches the network. Verified from a clean clone
with an empty Zig cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012HBHFhoTYa8TU9GLwobfbx

+35 -12
+1
flake.nix
··· 36 36 rec { 37 37 zsmtp = pkgs.callPackage ./nix/package.nix { }; 38 38 default = zsmtp; 39 + zig-pkg = pkgs.callPackage ./nix/zig-deps.nix { }; 39 40 } 40 41 ); 41 42
+4 -12
nix/package.nix
··· 4 4 { 5 5 lib, 6 6 stdenv, 7 + callPackage, 7 8 zig_0_16, 8 - fetchzip, 9 9 }: 10 10 let 11 - # Must match the url/hash pinned in build.zig.zon. Only the files listed in 12 - # the dependency's `paths` may end up in zig-pkg/, since Zig hashes the 13 - # package contents against the directory name. 14 - tlsDep = fetchzip { 15 - name = "tls.zig-src"; 16 - url = "https://github.com/ianic/tls.zig/archive/e04ae448ce7ee70c136d4d48b059314543203809.tar.gz"; 17 - hash = "sha256-afPTfauIV49IATX0szuOdKLloyqI4XKsyNk8KkasAvg="; 18 - }; 19 - tlsDepId = "tls-0.1.0-ER2e0jGpBgCkVC-Yp12NgSdHNUtZr52MleJ8roHlUa54"; 11 + zigDeps = callPackage ./zig-deps.nix { }; 20 12 in 21 13 stdenv.mkDerivation { 22 14 pname = "zsmtp"; ··· 29 21 # Provide the dependency offline through the project-local package 30 22 # directory, which the build consults before fetching. 31 23 postPatch = '' 32 - mkdir -p zig-pkg/${tlsDepId} 33 - cp -r ${tlsDep}/{build.zig,build.zig.zon,readme.md,src} zig-pkg/${tlsDepId}/ 24 + mkdir -p zig-pkg 25 + cp -r ${zigDeps}/* zig-pkg/ 34 26 ''; 35 27 36 28 dontConfigure = true;
+25
nix/zig-deps.nix
··· 1 + # SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us> 2 + # SPDX-License-Identifier: MIT 3 + 4 + # The project-local Zig package directory (zig-pkg/) as a derivation, so 5 + # builds can run without Zig fetching anything over the network. Only the 6 + # files listed in each dependency's `paths` may be present, since Zig 7 + # hashes the package contents against the directory name. 8 + 9 + { 10 + runCommand, 11 + fetchzip, 12 + }: 13 + let 14 + # Must match the url/hash pinned in build.zig.zon. 15 + tlsDep = fetchzip { 16 + name = "tls.zig-src"; 17 + url = "https://github.com/ianic/tls.zig/archive/e04ae448ce7ee70c136d4d48b059314543203809.tar.gz"; 18 + hash = "sha256-afPTfauIV49IATX0szuOdKLloyqI4XKsyNk8KkasAvg="; 19 + }; 20 + tlsDepId = "tls-0.1.0-ER2e0jGpBgCkVC-Yp12NgSdHNUtZr52MleJ8roHlUa54"; 21 + in 22 + runCommand "zsmtp-zig-pkg" { } '' 23 + mkdir -p $out/${tlsDepId} 24 + cp -r ${tlsDep}/{build.zig,build.zig.zon,readme.md,src} $out/${tlsDepId}/ 25 + ''
+5
.forgejo/workflows/publish.yaml
··· 15 15 - name: Checkout 16 16 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 17 17 18 + # Materialize the Zig dependencies from nix so zig never has to 19 + # fetch over the network on the runner. 20 + - name: Materialize Zig dependencies 21 + run: cp -r --no-preserve=mode "$(nix build --print-out-paths .#zig-pkg)" zig-pkg 22 + 18 23 - name: Build docs 19 24 run: nix develop -c zig build docs 20 25