feat: add option for debugger configs

This commit is contained in:
Ching Pei Yang 2023-05-08 13:01:42 +02:00
parent 1eceb04db9
commit 624782e196
2 changed files with 13 additions and 3 deletions

View file

@ -11,9 +11,13 @@ in {
(mkIf cfg.enable { (mkIf cfg.enable {
vim.startPlugins = ["nvim-dap"]; vim.startPlugins = ["nvim-dap"];
vim.luaConfigRC.nvim-dap = vim.luaConfigRC =
nvim.dag.entryAnywhere '' {
nvim-dap = nvim.dag.entryAnywhere ''
local dap = require("dap")
''; '';
}
// mapAttrs (_: v: (nvim.dag.entryAfter ["nvim-dap"] v)) cfg.sources;
}) })
(mkIf (cfg.enable && cfg.ui.enable) { (mkIf (cfg.enable && cfg.ui.enable) {
vim.startPlugins = ["nvim-dap-ui"]; vim.startPlugins = ["nvim-dap-ui"];

View file

@ -11,5 +11,11 @@ with lib; {
description = "Automatically Opens and Closes DAP-UI upon starting/closing a debugging session"; description = "Automatically Opens and Closes DAP-UI upon starting/closing a debugging session";
}; };
}; };
sources = mkOption {
default = {};
description = "List of debuggers to install";
type = with types; attrsOf string;
};
}; };
} }