Something went wrong. Try again.
A Microsoft 365 mail client library for Zig, over Microsoft Graph
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566# 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-o365"; 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 Microsoft # Graph written a few hundred lines away, on a loopback socket the build # sandbox has. doCheck = true;
meta = { description = "A Microsoft 365 mail client library for Zig, over Microsoft Graph"; homepage = "https://git.jcollie.dev/jeff/zig-o365"; license = lib.licenses.mit; platforms = lib.platforms.unix; };})