Something went wrong. Try again.
A Gmail API client library for Zig: labels, messages, and the mailbox history that turns a second sync into an update.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us># SPDX-License-Identifier: MIT
{ lib, stdenv, callPackage, zig_0_17,}:let # Generated from build.zig.zon by zon2nix; regenerate with # nix develop -c zon2nix --17 --nix=build.zig.zon.nix build.zig.zon # # A Nix build has no network and the Zig package manager wants one, so the # dependencies are fetched by Nix into a link farm named by Zig package # hash -- the layout of `p/` in Zig's global cache -- and handed over with # `--system`. zigDeps = callPackage ./build.zig.zon.nix { };instdenv.mkDerivation (finalAttrs: { pname = "zig-gmail"; version = "0.2.0";
# Named rather than filtered, so that editing something outside this list -- # the flake, the README, a scratch file -- does not rebuild the package. src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [ ./build.zig ./build.zig.zon ./src ./tests ./tools ./LICENSES ./README.md ./REUSE.toml ]; };
nativeBuildInputs = [ zig_0_17.hook ];
# `--system` does not merely offer the directory, it forbids fetching # outright: a dependency missing from it is a build error naming the # package, rather than a silent attempt to reach the network. zigBuildFlags = [ "--system" "${zigDeps}" ]; # The check phase assembles its own flags rather than reusing the build's, # so without this `zig build test` runs without --system, tries to fetch, # and fails in the sandbox. zigCheckFlags = finalAttrs.zigBuildFlags;
# The tests are pure: the ones that would need a network talk to a Gmail # written a hundred lines away, on a loopback socket the build sandbox has. doCheck = true;
meta = { description = "A Gmail API client library for Zig"; homepage = "https://git.jcollie.dev/jeff/zig-gmail"; license = lib.licenses.mit; platforms = lib.platforms.unix; };})