# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie # SPDX-License-Identifier: MIT { lib, stdenv, callPackage, zig_0_16, }: let # Generated from build.zig.zon by zon2nix; regenerate with # nix develop -c zon2nix --16 --nix=build.zig.zon.nix build.zig.zon zigDeps = callPackage ./build.zig.zon.nix { }; in stdenv.mkDerivation (finalAttrs: { pname = "zig-maildir"; version = "0.0.0"; # Named rather than filtered, so that editing something outside this list -- # the flake, a scratch file, the NixOS tests that consume the result -- does # not rebuild the package and, in the tests, the whole virtual machine. src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [ ./build.zig ./build.zig.zon ./build.zig.zon.nix ./src ./tests ./tools ./LICENSES ./README.md ./REUSE.toml ]; }; nativeBuildInputs = [ zig_0_16.hook ]; # `--system` does not merely offer the directory, it forbids fetching: a # dependency missing from it is a build error naming the package rather than # a silent attempt to reach a network the sandbox does not have. 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 and tries to fetch. zigCheckFlags = finalAttrs.zigBuildFlags; # The end-to-end tests want a directory to make a maildir in, which the # build sandbox has; nothing here needs a network or a second process. doCheck = true; meta = { description = "A maildir and Maildir++ library for Zig"; homepage = "https://git.jcollie.dev/jeff/zig-maildir"; license = lib.licenses.mit; mainProgram = "zig-maildir"; platforms = lib.platforms.unix; }; })