From 624782e1963c5c0c8c1cd83d5ea14134ab0d78c8 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 8 May 2023 13:01:42 +0200 Subject: [PATCH] feat: add option for debugger configs --- modules/debugger/nvim-dap/config.nix | 10 +++++++--- modules/debugger/nvim-dap/nvim-dap.nix | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/debugger/nvim-dap/config.nix b/modules/debugger/nvim-dap/config.nix index cf188974..b3d08f7a 100644 --- a/modules/debugger/nvim-dap/config.nix +++ b/modules/debugger/nvim-dap/config.nix @@ -11,9 +11,13 @@ in { (mkIf cfg.enable { vim.startPlugins = ["nvim-dap"]; - vim.luaConfigRC.nvim-dap = - nvim.dag.entryAnywhere '' - ''; + vim.luaConfigRC = + { + 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) { vim.startPlugins = ["nvim-dap-ui"]; diff --git a/modules/debugger/nvim-dap/nvim-dap.nix b/modules/debugger/nvim-dap/nvim-dap.nix index 1a9f2fe5..159f88e8 100644 --- a/modules/debugger/nvim-dap/nvim-dap.nix +++ b/modules/debugger/nvim-dap/nvim-dap.nix @@ -11,5 +11,11 @@ with lib; { 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; + }; }; }