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.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171# generated by zon2nix (https://github.com/jcollie/zon2nix){ lib, linkFarm, fetchzip, fetchurl, fetchgit, runCommandLocal, zig_0_16, zstd, name ? "zig-packages",}:let unpackZigArtifact = { name, artifact, }: runCommandLocal name { nativeBuildInputs = [ zig_0_16 ]; } '' # workaround https://codeberg.org/ziglang/zig/issues/31866 # https://github.com/Cloudef/zig2nix/issues/54 mkdir "$TMPDIR/src" "$TMPDIR/cache" "$TMPDIR/cache/tmp" touch "$TMPDIR/src/build.zig" hash="$(cd "$TMPDIR/src" && zig fetch --global-cache-dir "$TMPDIR/cache" ${artifact})" mkdir "$out" tar zxvf "$TMPDIR/cache/p/$hash.tar.gz" --directory "$out/" --strip-components=1 '';
fetchZig = { name, url, hash, unpack, }: let artifact = if unpack then fetchzip { inherit url hash; nativeBuildInputs = [ zstd ]; } else fetchurl { inherit url hash; }; in unpackZigArtifact { inherit name artifact; };
fetchGitZig = { name, url, hash, }: let parts = lib.splitString "#" url; url_base = builtins.elemAt parts 0; url_without_query = builtins.elemAt (lib.splitString "?" url_base) 0; rev_base = builtins.elemAt parts 1; rev = if builtins.match "^[a-fA-F0-9]{40}$" rev_base != null then rev_base else "refs/heads/${rev_base}"; in fetchgit { inherit name rev hash; url = url_without_query; deepClone = false; fetchSubmodules = false; };
fetchZigArtifact = { name, url, hash, unpack, }: let parts = lib.splitString "://" url; proto = builtins.elemAt parts 0; path = builtins.elemAt parts 1; fetcher = { "git+http" = fetchGitZig { inherit name hash; url = "http://${path}"; }; "git+https" = fetchGitZig { inherit name hash; url = "https://${path}"; }; http = fetchZig { inherit name hash unpack; url = "http://${path}"; }; https = fetchZig { inherit name hash unpack; url = "https://${path}"; }; }; in fetcher.${proto}; # The packages, as real directories holding symlinked files, rather than as # a farm of symlinked directories. # # Zig runs a dependency's own build steps with the working directory set to # that dependency, and points at the program to run with a path counted in # directories up from there. Through a symlink the two disagree: Zig counts # from `<farm>/<package>/`, four directories below the root, while the kernel # resolves the working directory to `/nix/store/<hash>`, which is three, so # the path lands one short of where the program is. # # It works anyway when the build directory is `/build`, because the sum then # overshoots into the root and going above the root stays there. It fails # when the build directory is under `/nix/var/nix/builds`, which is where Nix # puts it when the sandbox is off. Real directories make the two depths # agree, so it works either way. # # The files have to be real as well, which is the expensive part and cannot # be avoided. `--symbolic-link` would leave them pointing into each # dependency's own store path, so that the farm is a few megabytes rather # than a second copy of every dependency -- but Zig's # `installHeadersDirectory` walks the directory and copies only the entries # whose kind is `.file`. Symlinked headers are skipped without a word, and # the first thing to include one fails with `'dcimgui.h' not found`. # # `--link` is not the way out. A hard link into a Nix output is a file the # builder did not create: inside the Linux sandbox the store is a separate # mount and `link` fails with `Invalid cross-device link`, while on Darwin it # succeeds and leaves root-owned files in the output, which Nix refuses while # canonicalising with `invalid ownership on file`. # # So it is a real copy, with `--reflink=auto` to share the blocks on a # filesystem that can. `nix store optimise` recovers the duplication after # the fact, hard-linking identical files across the store, which is the # store's own business to do and not a build's. copyFarm = farm: entries: pathDependencyPackages: runCommandLocal farm { # The packages whose own manifest declares a dependency by `.path`. # Zig 0.16.0 cannot build these through `zig build --system`: it spins # in userspace forever, because a `.path` dependency's hash is computed # against the system package directory during the fetch and against the # real global cache afterwards, and in that mode the two disagree. A # package that wants `--system` copies each of these into its build # root and passes `--fork=`; see the README. passthru = { inherit pathDependencyPackages; }; } '' mkdir -p "$out" cp --recursive --reflink=auto --dereference --no-preserve=mode \ ${linkFarm farm entries}/. "$out/" '';incopyFarm name [ { name = "oidc-0.1.0-mPPUnVgPBAAR-rw3mmYtN8PmHG334s-gftmkMnf-aKsP"; path = fetchZigArtifact { name = "oidc"; url = "git+https://git.jcollie.dev/jeff/zig-oidc.git#b9891435591dce17c063bf9dc9124609f57d5bec"; hash = "sha256-wi6W2G72w4Kuqke1oTA1/jE7/RFhbi4nkpM40Do5hXo="; unpack = true; }; } ] [ ]