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

  config =
    lib.mkIf
    config.dotfiles.inputs.nixvim.programs.nixvim.plugins.trouble.enable
    {
      programs.nixvim = {
        keymaps = [
          {
            action = ''
              function() require("trouble").toggle("workspace_diagnostics") end
            '';

            key = "<leader>ll";
            lua = true;
            mode = "n";
            options.silent = true;
          }
        ];

        plugins.trouble.enable = true;
      };
    };
}
