diff --git a/config/dap.nix b/config/dap.nix new file mode 100644 index 0000000..dbde972 --- /dev/null +++ b/config/dap.nix @@ -0,0 +1,29 @@ +{ + plugins = { + dap = { + enable = true; + luaConfig.post = '' + local dap = require('dap') + dap.adapters.lldb = { + type = 'executable', + command = '/run/current-system/sw/bin/lldb-dap', -- adjust as needed, must be absolute path + name = 'lldb' + } + dap.configurations.cpp = { + { + name = 'Launch', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = "''${workspaceFolder}", + stopOnEntry = false, + args = {}, + runInTerminal = true, + }, + } + ''; + }; + }; +} diff --git a/config/default.nix b/config/default.nix index ca028b6..2d29d21 100644 --- a/config/default.nix +++ b/config/default.nix @@ -8,6 +8,7 @@ ./treesitter.nix ./lsp-format.nix ./lsp.nix + ./dap.nix ]; opts = { number = true;