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 { in {
options.plugins.gitsigns = { options.plugins.gitsigns = {
enable = mkEnableOption "gitsigns plugin"; enable = mkEnableOption "gitsigns plugin";
package = helpers.mkPackageOption "gitsigns" pkgs.vimPlugins.gitsigns-nvim; 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 = { signs = {
add = signOptions { add = signOptions {
hl = "GitSignsAdd"; hl = "GitSignsAdd";
@ -321,6 +329,9 @@ in {
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [cfg.package]; extraPlugins = [cfg.package];
extraPackages = optional (cfg.gitPackage != null) cfg.gitPackage;
extraConfigLua = let extraConfigLua = let
luaFnOrStrToObj = val: luaFnOrStrToObj = val:
if val == null if val == null