From 5bb4a001e2544f83bc59f703e5bfcf8ae94e6ef1 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Thu, 5 Oct 2023 12:25:16 -0400 Subject: [PATCH] Add nvim-dap, lldb, llvm bintools, netcoredbg --- nix/base-system/flake.nix | 6 +++++- nix/base-system/init.lua | 38 ++++++++++++++++++++++++++++++++++++++ nix/darwin/flake.lock | 6 +++--- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index b8fac8b..82c31f2 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -104,7 +104,8 @@ EOF"; cmp-buffer cmp-path cmp-nvim-lsp-signature-help - vimspector + nvim-dap # Debug Adapter Protocol support + #nvim-dap-ui vimagit hoon-vim (nvim-treesitter.withPlugins (_: expected-parsers)) @@ -180,6 +181,7 @@ EOF"; octave kubo dotnet-sdk_7 + netcoredbg powershell rust-analyzer datasette @@ -189,6 +191,8 @@ EOF"; # TODO(jwall): I include these initially for nvim telescope ripgrep fd + lldb + llvmPackages.bintools-unwrapped # TODO add sonic-pi here if it supports the arch ]) ++ (with pkgs.ocamlPackages; [ dune_3 diff --git a/nix/base-system/init.lua b/nix/base-system/init.lua index 0e2b38e..44248da 100644 --- a/nix/base-system/init.lua +++ b/nix/base-system/init.lua @@ -486,3 +486,41 @@ vim.keymap.set("n", "tdb", function() vim.cmd("DBUIToggle") end) +local dap = require('dap') +dap.adapters.lldb = { + type = "executable", + command = "/run/current-system/sw/bin/lldb", + name = "lldb", +} + +dap.adapters.coreclr = { + type = 'executable', + command = '/run/current-system/sw/bin/netcoredbg', + args = {'--interpreter=vscode'} +} + +dap.configurations.rust = { + { + name = 'Launch Rust', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + }, +} + +dap.configurations.cs = { + { + name = "Launch - netcoredbg", + type = "coreclr", + request = "launch", + program = function() + return vim.fn.input('Path to dll', vim.fn.getcwd(), 'file') + end, + }, +} + diff --git a/nix/darwin/flake.lock b/nix/darwin/flake.lock index 1e3eff2..a246eb5 100644 --- a/nix/darwin/flake.lock +++ b/nix/darwin/flake.lock @@ -36,12 +36,12 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-ge0QKt8Mmq+7YdLpqmFPrTQGrCD4qnST31sdkbaFydY=", - "path": "/nix/store/zdq6wjlqxwrd05vk17lgx3sr5fy8wn0w-source/nix/base-system", + "narHash": "sha256-I0oQ+d0VQJ7f+SEZWdSiQfsfgSfGIP5U8hZ0rA4wHOM=", + "path": "/nix/store/fk5p4y8fpc1ly46d2c2byca4g20ianwh-source/nix/base-system", "type": "path" }, "original": { - "path": "/nix/store/zdq6wjlqxwrd05vk17lgx3sr5fy8wn0w-source/nix/base-system", + "path": "/nix/store/fk5p4y8fpc1ly46d2c2byca4g20ianwh-source/nix/base-system", "type": "path" } },