modules/dependencies: add which

This commit is contained in:
Gaetan Lepage 2025-04-07 15:49:34 +02:00 committed by nix-infra-bot
parent 9abe8fd025
commit 9cc70f8c03
3 changed files with 14 additions and 16 deletions

View file

@ -14,6 +14,7 @@ let
example = [ "gitMinimal" ];
};
ueberzug.default = "ueberzugpp";
which.default = "which";
};
mkDependencyOption = name: properties: {

View file

@ -2,7 +2,6 @@
lib,
helpers,
config,
pkgs,
...
}:
with lib;
@ -112,12 +111,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
};
};
extraOptions = {
whichPackage = lib.mkPackageOption pkgs "which" {
nullable = true;
};
};
extraConfig = cfg: {
assertions = lib.nixvim.mkAssertions "plugins.neogit" (
map
@ -140,10 +133,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
]
);
dependencies.git.enable = lib.mkDefault true;
dependencies = {
git.enable = lib.mkDefault true;
extraPackages = optional (hasInfix "which" (
cfg.settings.commit_view.verify_commit.__raw or ""
)) cfg.whichPackage;
which.enable =
let
autoInstallWhich = hasInfix "which" (cfg.settings.commit_view.verify_commit.__raw or "");
in
lib.mkIf autoInstallWhich (lib.mkDefault true);
};
};
}

View file

@ -294,11 +294,11 @@
};
no-packages = {
plugins.neogit = {
enable = true;
whichPackage = null;
};
plugins.neogit.enable = true;
dependencies.git.enable = false;
dependencies = {
git.enable = false;
which.enable = false;
};
};
}