plugins/gitsigns: add gitPackage option

This commit is contained in:
Gaetan Lepage 2024-02-07 10:51:13 +01:00 committed by Gaétan Lepage
parent ff57525a64
commit eaa1736151

View file

@ -37,7 +37,15 @@ with lib; let
in {
options.plugins.gitsigns = {
enable = mkEnableOption "gitsigns plugin";
package = helpers.mkPackageOption "gitsigns" pkgs.vimPlugins.gitsigns-nvim;
gitPackage = mkOption {
type = with types; nullOr package;
default = pkgs.git;
description = "Which package to use for git.";
};
signs = {
add = signOptions {
hl = "GitSignsAdd";
@ -321,6 +329,9 @@ in {
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraPackages = optional (cfg.gitPackage != null) cfg.gitPackage;
extraConfigLua = let
luaFnOrStrToObj = val:
if val == null