diff --git a/README.md b/README.md index b99a221b..804c4d6c 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ transport; its revision and unpacked source hash are pinned in also verifies the native compatibility contract and runtime closure, runs the package tests, and checks installed completions. `nix develop` supplies the Rust toolchain and the same native artifact, without Zig. +GitHub-hosted Zig dependency archives use fixed-output downloads with the original +URL followed by an equivalent `codeload.github.com` fallback. URLs and archive +checksums come from Ghostty's pinned package manifest; the Zig package-cache +output hash is unchanged. This improves cold-cache build reliability without +changing runtime behavior or dependency contents. With Cargo (see the build requirements below): diff --git a/flake.nix b/flake.nix index 2e193d70..220bc378 100644 --- a/flake.nix +++ b/flake.nix @@ -56,6 +56,29 @@ hash = ghosttyContract.sourceHash; }; + # Keep transport mirrors separate from Zig's package content pins. + # Upstream's manifest supplies both archive byte hashes and cache names. + ghosttyGithubArchives = map + (package: + let + archiveUrl = builtins.match + "https://github.com/([^/]+/[^/]+)/archive/(.+)\\.tar\\.gz" + package.url; + in package // { + archive = pkgs.fetchurl { + urls = [ + package.url + "https://codeload.github.com/${builtins.elemAt archiveUrl 0}/tar.gz/${builtins.elemAt archiveUrl 1}" + ]; + sha256 = package.sha256; + }; + }) + (builtins.filter + (package: package.type == "archive" && builtins.match + "https://github.com/([^/]+/[^/]+)/archive/(.+)\\.tar\\.gz" + package.url != null) + (builtins.fromJSON (builtins.readFile "${ghosttySrc}/flatpak/zig-packages.json"))); + # Ghostty's zig package cache, in the layout `zig build --system