diff --git a/packaging/dependencies.nix b/packaging/dependencies.nix
index 424053dea..498bc08d0 100644
--- a/packaging/dependencies.nix
+++ b/packaging/dependencies.nix
@@ -133,16 +133,18 @@ scope: {
     cmakeFlags = attrs.cmakeFlags or []
       ++ [ "-DUSE_SSH=exec" ];
     nativeBuildInputs = attrs.nativeBuildInputs or []
-      ++ [
+      # gitMinimal does not build on Windows. See packbuilder patch.
+      ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
         # Needed for `git apply`; see `prePatch`
         pkgs.buildPackages.gitMinimal
       ];
     # Only `git apply` can handle git binary patches
-    prePatch = ''
-      patch() {
-        git apply
-      }
-    '';
+    prePatch = attrs.prePatch or ""
+      + lib.optionalString (!stdenv.hostPlatform.isWindows) ''
+        patch() {
+          git apply
+        }
+      '';
     patches = attrs.patches or []
 <<<<<<< HEAD
       ++ [ ./patches/libgit2-mempack-thin-packfile.patch ];
@@ -150,7 +152,10 @@ scope: {
 =======
       ++ [
         ./patches/libgit2-mempack-thin-packfile.patch
-
+      ]
+      # gitMinimal does not build on Windows, but fortunately this patch only
+      # impacts interruptibility
+      ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
         # binary patch; see `prePatch`
         ./patches/libgit2-packbuilder-callback-interruptible.patch
       ];