mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 09:49:48 +01:00
(lazygit) add option package
This commit is contained in:
parent
f8ff3cd9fa
commit
2018cd7b2f
2 changed files with 17 additions and 3 deletions
|
@ -9,7 +9,8 @@ with builtins; let
|
|||
toggleKey = "<c-t>";
|
||||
in {
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
(
|
||||
mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"toggleterm-nvim"
|
||||
];
|
||||
|
@ -39,10 +40,17 @@ in {
|
|||
(
|
||||
mkIf (cfg.enable && cfg.lazygit.enable)
|
||||
{
|
||||
vim.luaConfigRC.toggleterm-lazygit = mkIf cfg.lazygit.enable nvim.dag.entryAfter ["toggleterm"] ''
|
||||
vim.startPlugins = lib.optionals (cfg.lazygit.package != null) [
|
||||
cfg.lazygit.package
|
||||
];
|
||||
vim.luaConfigRC.toggleterm-lazygit = nvim.dag.entryAfter ["toggleterm"] ''
|
||||
local terminal = require 'toggleterm.terminal'
|
||||
local lazygit = terminal.Terminal:new({
|
||||
cmd = "lazygit",
|
||||
cmd = '${
|
||||
if (cfg.lazygit.package != null)
|
||||
then getExe cfg.lazygit.package
|
||||
else "lazygit"
|
||||
}',
|
||||
direction = '${cfg.lazygit.direction}',
|
||||
hidden = true,
|
||||
on_open = function(term)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
|
@ -24,6 +25,11 @@ with builtins; {
|
|||
default = "float";
|
||||
description = "Direction of the lazygit window";
|
||||
};
|
||||
package = mkOption {
|
||||
type = with types; nullOr package;
|
||||
default = pkgs.lazygit;
|
||||
description = "The package to use for lazygit, null means do not install automatically";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue