# 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 rather than as a farm of symlinks. # # 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 `//`, four directories below the root, while the kernel # resolves the working directory to `/nix/store/`, 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. Copying makes the two depths agree, so it # works either way. copyFarm = farm: entries: runCommandLocal farm { } '' mkdir -p "$out" cp --recursive --dereference --reflink=auto --no-preserve=mode \ ${linkFarm farm entries}/. "$out/" ''; in copyFarm name [ { name = "known_folders-0.0.0-Fy-PJk7KAAC41mQXzmFyGa0Q7tvmQjatENkREa6Gc4zu"; path = fetchZigArtifact { name = "known_folders"; url = "git+https://github.com/ziglibs/known-folders#175f5596b3d2ee3c658282bb07885580895a0e73"; hash = "sha256-gTnTyqkAAT5AYXxbG80ybiiRk+pOkm7dvqThcNWGmpo="; unpack = true; }; } { name = "lsp_kit-0.1.0-bi_PL_kyDACVTEhLaMq2-PJx0MocqRyjXDAN0ybMUyQQ"; path = fetchZigArtifact { name = "lsp_kit"; url = "git+https://github.com/zigtools/lsp-kit#ec325a3c33d1da7708cf513355208f74d9560580"; hash = "sha256-60F2BOCrl3CreQFmpH3HAz6zzxd3VgJ3iSEkP39gtgQ="; unpack = true; }; } { name = "macaddress-0.0.0-x_IWiqxdAADgZ6W5lxDUorcTiW63i2sO0LRvr6VtfS71"; path = fetchZigArtifact { name = "macaddress"; url = "git+https://git.jcollie.dev/jeff/zig-macaddress.git#f070b7664b1bf031c065e70248578211f0334852"; hash = "sha256-dYuTZehACpmb2rGxvhovJpKEabkx8KP+xSfJRHLWtp4="; unpack = true; }; } { name = "pipewire-0.1.0-lH35HusiBACjmg25_hcNJOTjMGFfSKyczRK3_6wSG95i"; path = fetchZigArtifact { name = "pipewire"; url = "git+https://git.jcollie.dev/jeff/zig-pipewire.git?ref=main#1af83e5134fb72aeb1e3f583a3bc2f87d587ec22"; hash = "sha256-AH6FszefoUscEvO9wmPK1tHVT/9YYc98QkUOy08vBqo="; unpack = true; }; } { name = "shrinkit-0.0.0-GRYwpSwGAwCjR5WiQiq-WDpC1NV9hvglB_UStLrqS4LN"; path = fetchZigArtifact { name = "shrinkit"; url = "git+https://git.jcollie.dev/jeff/zig-shrinkit.git#227e1144a3b641dde19e09415077590b562f64d6"; hash = "sha256-bjGaYLwOfkbHbihgV0B3RpPuHKsyjh/O2w1Yjh3w68Y="; unpack = true; }; } { name = "uucode-0.2.0-ZZjBPlK5VADj7fdoq7G8LIHzD5o6FSkcBXXrRWr4jnrA"; path = fetchZigArtifact { name = "uucode"; url = "git+https://github.com/jacobsandlund/uucode#2826a37a4562284fdacd8fa029d49509cc9bffcd"; hash = "sha256-R5RXW5tWIaDq5JOF2+oWd5YOYOyns6WH7f687WE+b20="; unpack = true; }; } { name = "vaxis-0.6.0-BWNV_MjFCQCs9UDHiRkrgw_ayeiPkzOe4xVbaAqXkUWW"; path = fetchZigArtifact { name = "vaxis"; url = "git+https://github.com/rockorager/libvaxis.git#c1e1f23be38951c425cdf31af455ba23ef178940"; hash = "sha256-bIXu8lGwGo42QbItC0jOi/eN7u+f4snknBexw7dc0DI="; unpack = true; }; } { name = "z2d-0.12.2-pre-j5P_HtA8EQDpzu5RUtQhr_Sn9MeQF3_q7rWMw3ouesd0"; path = fetchZigArtifact { name = "z2d"; url = "git+https://github.com/vancluever/z2d.git#47fc1030c1636dcfb75ea1cc238f706dd1feb379"; hash = "sha256-KBtakus3/aKXBl31lxmKUkfHdr6QCDbUkOeeZw7usBo="; unpack = true; }; } { name = "z46-0.1.0-_AxhwEUQAwDd7nkshEwgp9a249_l8YsdXK5kXgNhemgd"; path = fetchZigArtifact { name = "z46"; url = "git+https://git.jcollie.dev/jeff/z46.git#6b1eb253e60bb2f6f13f9e2e9bd41ec1e4f3e6da"; hash = "sha256-nW/l/iu/XVgII/nbUfKsmZAkqDbdAWSPXPvriB7OSjY="; unpack = true; }; } { name = "ziggy-0.1.0-kTg8v0NWBgAyFtS5awtOlKnC7ddvefR_I0Xh3XQyi7p1"; path = fetchZigArtifact { name = "ziggy"; url = "git+https://github.com/kristoff-it/ziggy#0b61581980d6905dd4108a618d602f5778593122"; hash = "sha256-hCzbPyBX62YLvMzat3jKlhXPPsY4pv2/Hs2iLKi5Cwo="; unpack = true; }; } { name = "zigimg-0.1.0-8_eo2oyaFwBZwJpmqPkCfVXWBrHcqbYwmrp1I6bTD3lI"; path = fetchZigArtifact { name = "zigimg"; url = "git+https://github.com/zigimg/zigimg#d695acd97c02e57bb151e8f659d1280f5cd6ca70"; hash = "sha256-0IYATQldT6eJxRR2T/2CsIYZuzomqjvmdVyjmsjguyE="; unpack = true; }; } ]