From f4f7b478624cbda2d22807f138d03678e616c43f Mon Sep 17 00:00:00 2001 From: danisharora099 Date: Thu, 27 Aug 2026 16:28:54 +0530 Subject: [PATCH] fix: apply logos-nix's fetchCargoVendor User-Agent overlay to native package sets crates.io returns 403 to the pinned nixpkgs' UA-less fetchCargoVendor helper, so every module release's cargo vendoring fails (#159). logos-nix#6 carries the upstream fix as lib.overlays.fetchCargoVendorUserAgent, but this repo does its own `import nixpkgs` in mkPkgsWith, so the overlay never reached module builds. Thread it in there, guarded so a logos-nix pin that predates the attribute still evaluates (no-op until the lock bump). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Ezs1fWormzPw9QqU89oAFU --- lib/common.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/common.nix b/lib/common.nix index c97f1ce..c507e7a 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -96,9 +96,19 @@ let # x86_64-windows cannot be produced by `import nixpkgs { system = ...; }` -- # it needs localSystem/crossSystem plus logos-nix's mingw overlays, which is # exactly what logos-nix.lib.mkWindowsPkgs wraps. + # + # Native sets carry logos-nix's fetchCargoVendor User-Agent overlay (crates.io + # 403s the pin's UA-less helper: logos-module-builder#159, logos-nix#6). + # Optional-guarded so a logos-nix pin predating the attribute still evaluates. mkPkgsWith = extraOverlays: system: if system != "x86_64-windows" then - import nixpkgs { inherit system; overlays = extraOverlays; } + import nixpkgs { + inherit system; + overlays = + lib.optional (logos-nix != null && logos-nix ? lib.overlays.fetchCargoVendorUserAgent) + logos-nix.lib.overlays.fetchCargoVendorUserAgent + ++ extraOverlays; + } else if logos-nix == null then throw ("logos-module-builder: targeting x86_64-windows requires the " + "logos-nix input to be threaded into the builder lib.")