{pkgs, ...}: { plugins.dap = { enable = true; extensions = { dap-ui.enable = true; dap-go.enable = true; dap-python.enable = true; dap-virtual-text.enable = true; }; adapters = { executables = { lldb = { command = "${pkgs.llvmPackages.lldb}/bin/lldb-vscode"; }; }; servers.codelldb = rec { port = 13000; executable = { command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb"; args = ["--port" (builtins.toString port)]; }; }; }; configurations = rec { c = cpp; rust = cpp; cpp = [ { name = "Launch"; request = "launch"; type = "codelldb"; cwd = "\${workspaceFolder}"; stopOnEntry = false; runInTerminal = false; program = { __raw = '' get_program ''; }; } { name = "Launch with Arguments"; request = "launch"; type = "codelldb"; cwd = "\${workspaceFolder}"; stopOnEntry = false; runInTerminal = false; program = { __raw = '' get_program ''; }; args = { __raw = '' function() local arguments_string = vim.fn.input('Executable arguments: ') return vim.split(arguments_string, " +") end ''; }; } ]; }; }; keymaps = [ { action = ":DapToggleBreakpoint"; key = "db"; options = { silent = true; }; } { action = ":DapUiToggle"; key = "du"; options = { silent = true; }; } { action = ":DapContinue"; key = "dc"; options = { silent = true; }; } { action = ":DapRerun"; key = "dC"; options = { silent = true; }; } { action = ":DapStepOver"; key = "do"; options = { silent = true; }; } { action = ":DapStepIn"; key = "di"; options = { silent = true; }; } { action = ":DapStepOut"; key = "dO"; options = { silent = true; }; } { action = ":DapTerminate"; key = "dT"; options = { silent = true; }; } { action = ":DapToggleRepl"; key = "dr"; options = { silent = true; }; } ]; }