diff --git a/plugins/git/neogit/default.nix b/plugins/git/neogit/default.nix index 45b2cb33..6ebe9e2f 100644 --- a/plugins/git/neogit/default.nix +++ b/plugins/git/neogit/default.nix @@ -9,7 +9,6 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin config { name = "neogit"; defaultPackage = pkgs.vimPlugins.neogit; - extraPackages = [ pkgs.git ]; maintainers = [ maintainers.GaetanLepage ]; @@ -102,6 +101,13 @@ helpers.neovim-plugin.mkNeovimPlugin config { }; }; + extraOptions = { + gitPackage = helpers.mkPackageOption { + name = "git"; + default = pkgs.git; + }; + }; + extraConfig = cfg: { assertions = map @@ -122,8 +128,9 @@ helpers.neovim-plugin.mkNeovimPlugin config { "fzf-lua" ]; - extraPackages = optional (hasInfix "which" ( - cfg.settings.commit_view.verify_commit.__raw or "" - )) pkgs.which; + extraPackages = [ + cfg.gitPackage + ] ++ optional (hasInfix "which" (cfg.settings.commit_view.verify_commit.__raw or "")) pkgs.which; + }; } diff --git a/tests/test-sources/plugins/git/neogit.nix b/tests/test-sources/plugins/git/neogit.nix index a2037a3c..95b410c0 100644 --- a/tests/test-sources/plugins/git/neogit.nix +++ b/tests/test-sources/plugins/git/neogit.nix @@ -290,4 +290,11 @@ }; }; }; + + no-packages = { + plugins.neogit = { + enable = true; + gitPackage = null; + }; + }; }