Something went wrong. Try again.
Reading, writing and creating MIME and RFC 5322 email messages in Zig.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us># SPDX-License-Identifier: MIT
{ description = "zig-mime";
inputs = { nixpkgs = { url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; }; # Mine, not the one in nixpkgs, which is Jari Vetoniemi's original and # takes different options. zon2nix = { url = "github:jcollie/zon2nix"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; };
outputs = { nixpkgs, zon2nix, ... }: let inherit (nixpkgs) lib; makePackages = system: import nixpkgs { inherit system; }; forAllSystems = lib.genAttrs lib.systems.flakeExposed; in { packages = forAllSystems ( system: let pkgs = makePackages system; in rec { zig-mime = pkgs.callPackage ./package.nix { }; default = zig-mime; # The dependency farm on its own, so that a workflow job which runs # `zig build` for something other than the package -- the # documentation -- can be handed it without building the package to # get at it. zig-deps = pkgs.callPackage ./build.zig.zon.nix { }; } );
devShells = forAllSystems ( system: let pkgs = makePackages system; in { default = pkgs.mkShell { name = "zig-mime"; nativeBuildInputs = [ pkgs.zig_0_17 pkgs.git-pages-cli pkgs.pinact pkgs.reuse
# Wrapped so that the Zig it shells out to for `zig env` is the # one this project builds with, rather than whatever happens to # be on the caller's PATH. Without a Zig at all it prints # "unable to execute zig" and writes nothing, leaving the # previous build.zig.zon.nix in place looking untouched. (pkgs.symlinkJoin { name = "zon2nix"; paths = [ zon2nix.packages.${system}.zon2nix ]; nativeBuildInputs = [ pkgs.makeWrapper ]; postBuild = '' wrapProgram $out/bin/zon2nix \ --prefix PATH : ${lib.makeBinPath [ pkgs.zig_0_17 ]} ''; })
# Python's `email` package is the reference implementation that # everything else is checked against by hand: it parses the # awkward corners of RFC 2047 and RFC 2231 the way the rest of # the world's mail does, which is not always the way the RFCs # read. pkgs.python3 ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.kcov ]; }; } ); };}