From 9eabaaed935ffaccdb26ce0a70f3a7f2e58d23a2 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Fri, 12 Jun 2026 17:43:32 +0300 Subject: [PATCH 1/4] Update Flake inputs --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index d551349..543d705 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1779102034, - "narHash": "sha256-vZJZjLo513IeI8hjzHFc6TDezUd4uCE2Eq4SNO3DNNg=", + "lastModified": 1780952837, + "narHash": "sha256-Fwd1+spDtQ0hDyBwme6ufG3n4mY0UrjjFdYHv+G/Hds=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "687f05a9184cad4eaf905c48b63649e3a86f5433", + "rev": "e820eb4a444b46a19b2e03e8dfd2359439ff30fe", "type": "github" }, "original": { @@ -43,11 +43,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1779333539, - "narHash": "sha256-lpmN2lrBDZDPjov2cbD3bOOJsI0fkKolKXasYPCqSys=", + "lastModified": 1781234414, + "narHash": "sha256-HdA+P4fKRGOomkewnI/Tww5Wz4xK1O7+hDO90YAsPB4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "672fa5fc5608d5cd82286a6f69aaf84a40b4fe41", + "rev": "1d18bfe3de6244c641ca4e8011186d0981b81d76", "type": "github" }, "original": { From cdbbb6fbb344bcf37ecf99809b0b89956a7c6973 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Fri, 12 Jun 2026 17:44:56 +0300 Subject: [PATCH 2/4] Use fetch-cargo-vendor v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v2 fetcher uses a custom user-agent that doesn’t trigger crates.io rate limits so easily. --- overlays/default.nix | 4 ++-- src/sync/rust.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/overlays/default.nix b/overlays/default.nix index 2dcdc2c..0db9830 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -9,14 +9,14 @@ final: prev: { # Allow pre-fetching cargoHash. # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/rust/fetch-cargo-vendor.nix - fetch-cargo-vendor-util = prev.writers.writePython3Bin "fetch-cargo-vendor-util" { + fetch-cargo-vendor-util = prev.writers.writePython3Bin "fetch-cargo-vendor-util-v2" { libraries = with prev.python3Packages; [ requests ]; flakeIgnore = [ "E501" ]; - } (builtins.readFile "${prev.path}/pkgs/build-support/rust/fetch-cargo-vendor-util.py"); + } (builtins.readFile "${prev.path}/pkgs/build-support/rust/fetch-cargo-vendor-util-v2.py"); mkZedGrammar = grammar: diff --git a/src/sync/rust.rs b/src/sync/rust.rs index e2ddfb7..91cf43b 100644 --- a/src/sync/rust.rs +++ b/src/sync/rust.rs @@ -197,7 +197,7 @@ async fn generate_cargo_hash(name: &str, lockfile: &Path) -> anyhow::Result Date: Fri, 12 Jun 2026 16:03:03 +0100 Subject: [PATCH 3/4] Prefer v2 fetch-cargo-vendor if exists --- overlays/default.nix | 28 ++++++++++++++++++++-------- src/sync/rust.rs | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/overlays/default.nix b/overlays/default.nix index 0db9830..9741f79 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -9,14 +9,26 @@ final: prev: { # Allow pre-fetching cargoHash. # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/rust/fetch-cargo-vendor.nix - fetch-cargo-vendor-util = prev.writers.writePython3Bin "fetch-cargo-vendor-util-v2" { - libraries = with prev.python3Packages; [ - requests - ]; - flakeIgnore = [ - "E501" - ]; - } (builtins.readFile "${prev.path}/pkgs/build-support/rust/fetch-cargo-vendor-util-v2.py"); + # Prefer 'v2' script if exists. + fetch-cargo-vendor-util = + prev.writers.writePython3Bin "fetch-cargo-vendor-util" + { + libraries = with prev.python3Packages; [ + requests + ]; + flakeIgnore = [ + "E501" + ]; + } + + ( + builtins.readFile ( + if builtins.pathExists "${prev.path}/pkgs/build-support/rust/fetch-cargo-vendor-util-v2.py" then + "${prev.path}/pkgs/build-support/rust/fetch-cargo-vendor-util-v2.py" + else + "${prev.path}/pkgs/build-support/rust/fetch-cargo-vendor-util.py" + ) + ); mkZedGrammar = grammar: diff --git a/src/sync/rust.rs b/src/sync/rust.rs index 91cf43b..e2ddfb7 100644 --- a/src/sync/rust.rs +++ b/src/sync/rust.rs @@ -197,7 +197,7 @@ async fn generate_cargo_hash(name: &str, lockfile: &Path) -> anyhow::Result Date: Fri, 12 Jun 2026 16:10:49 +0100 Subject: [PATCH 4/4] Add required Python libraries for fetch-cargo-vendor --- overlays/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/overlays/default.nix b/overlays/default.nix index 9741f79..f277c94 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -13,9 +13,14 @@ final: prev: { fetch-cargo-vendor-util = prev.writers.writePython3Bin "fetch-cargo-vendor-util" { - libraries = with prev.python3Packages; [ - requests - ]; + libraries = + with prev.python3Packages; + [ + requests + tomli-w + ] + ++ requests.optional-dependencies.socks; # to support socks proxy envs like ALL_PROXY in requests + flakeIgnore = [ "E501" ];