nixeovim/modules/plugins/navigation/nvim-tree.nix
2024-04-27 02:44:28 +03:00

40 lines
859 B
Nix

{ config, lib, pkgs, ... }:
let cfg = config.plugins.navigation.nvim-tree; in
{
options.plugins.navigation.nvim-tree = with lib; with types; {
enable = mkEnableOption "nvim-tree";
package = mkPackageOption pkgs.vimPlugins "nvim-tree-lua" { };
settings = mkOption {
type = attrs;
default = { };
description = ''
`:help nvim-tree-setup`
'';
};
disableNetrw = mkOption {
type = bool;
default = true;
description = ''
Disabling netrw is strongly advised.
`:help nvim-tree-netrw`
'';
};
};
config = lib.mkIf cfg.enable {
plugin.nvim-tree-lua = {
name = "nvim-tree";
package = cfg.package;
setupSettings = cfg.settings;
};
vim.g = lib.mkIf cfg.disableNetrw {
loaded_netrw = 1;
loaded_netrwPlugin = 1;
};
};
}