From 29684586ff5869b45107829af6b98b1f164210cc Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Thu, 9 Jan 2025 12:44:26 -0500
Subject: [PATCH] fix(nvim): ensure path to git for neo-tree

---
 homeManagerModules/neovim/theme/default.nix | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/homeManagerModules/neovim/theme/default.nix b/homeManagerModules/neovim/theme/default.nix
index cf8c581b..3e7e133d 100644
--- a/homeManagerModules/neovim/theme/default.nix
+++ b/homeManagerModules/neovim/theme/default.nix
@@ -7,7 +7,7 @@ self: {
   inherit (self.inputs) nvim-theme-src;
   inherit (self.lib.${pkgs.system}) mkVersion;
 
-  inherit (lib) attrValues fileContents mkIf;
+  inherit (lib) attrValues fileContents getExe mkIf;
 
   cfg = config.programs.neovim;
 in {
@@ -105,7 +105,14 @@ in {
         }
 
         {
-          plugin = pkgs.vimPlugins.neo-tree-nvim;
+          plugin = pkgs.vimPlugins.neo-tree-nvim.overrideAttrs (o: {
+            postPatch = ''
+              ${o.postPatch or ""}
+              for file in $(${pkgs.findutils}/bin/find ./lua/neo-tree -type f -name "*.lua"); do
+                  substituteInPlace "$file" --replace-warn '"git"' '"${getExe pkgs.gitFull}"'
+              done
+            '';
+          });
           type = "lua";
           config = fileContents ./config/neotree.lua;
         }