{
  config,
  lib,
  ...
}: {
  options.dotfiles.inputs.nixvim.programs.nixvim.plugins.undotree.enable =
    lib.dotfiles.mkEnableOption;

  config =
    lib.mkIf
    config.dotfiles.inputs.nixvim.programs.nixvim.plugins.undotree.enable
    {
      programs.nixvim = {
        keymaps = [
          {
            action = "vim.cmd.UndotreeToggle";
            key = "<leader>u";
            lua = true;
            mode = "n";
            options.silent = true;
          }
        ];

        plugins.undotree.enable = true;
      };
    };
}
