From 4cf3f9aae8cadf965b9635b3d5d3d5f614f11924 Mon Sep 17 00:00:00 2001 From: Rohit Singh Date: Wed, 28 Jan 2026 04:09:51 -0500 Subject: [PATCH] google-cloud-sdk: rewrite vendored CA bundles --- pkgs/by-name/go/google-cloud-sdk/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/go/google-cloud-sdk/package.nix b/pkgs/by-name/go/google-cloud-sdk/package.nix index e9fae78d0826..8c2f1e1aa696 100644 --- a/pkgs/by-name/go/google-cloud-sdk/package.nix +++ b/pkgs/by-name/go/google-cloud-sdk/package.nix @@ -8,6 +8,7 @@ # { + cacert, stdenv, lib, fetchurl, @@ -168,6 +169,16 @@ stdenv.mkDerivation rec { $out/bin/gsutil version | grep -w "$(cat platform/gsutil/VERSION)" ''; + # Replace all vendored copies of CA bundle with the one used by Nixpkgs. + # This search/replace is a bit overzealous and replaces some files used by tests + # but it should cause no harm since we're not running those tests. + postFixup = '' + while IFS= read -rd "" f; do + echo "rewriting certificate bundle: $f" + ln -sf ${cacert}/etc/ssl/certs/ca-bundle.crt "$f" + done < <(find "$out" '(' -name cacert.pem -o -name cacerts.txt ')' -print0) + ''; + passthru = { inherit components withExtraComponents; updateScript = ./update.sh;