Compare commits

...

3 Commits

5 changed files with 121 additions and 1 deletions

49
docs/yoga-setup-log.md Normal file
View File

@ -0,0 +1,49 @@
### Installer system
```bash
fdisk /dev/sda
> g
> n
> 1
> 2048
> +512M
> t
> 1
> n
> 2
> default
> default
> t
> 2
> 20
> w
mkfs.fat -F 32 -n boot /dev/sda1
cryptsetup -y -v luksFormat /dev/sda2
cryptsetup -v luksOpen /dev/sda2 nixos
pvcreate /dev/mapper/nixos
vgcreate vg /dev/mapper/nixos
lvcreate -L 8G -n swap vg
lvcreate -L 100G -n root vg
lvcreate -L 100G -n root vg
lvcreate -L 100%FREE -n home vg
mkswap -L swap /dev/vg/swap
mkfs.ext4 -L root /dev/vg/root
mkfs.ext4 -L home /dev/vg/home
mount /dev/disk/by-label/root /mnt/
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot/
swapon /dev/disk/by-label/swap
nixos-generate-config --root /mnt
nano /mnt/etc/nixos/configuration.nix <- set hostname
nano /mnt/etc/nixos/hardware-configuration.nix <- set /dev/sda2 uuid as boot.initrd.luks.devices entry
nixos-install
reboot
```

View File

@ -0,0 +1,35 @@
local dap = require("dap")
local dapui = require("dapui")
dapui.setup()
vim.fn.sign_define("DapBreakpoint", { text = "🔴", texthl = "", linehl = "", numhl = "" })
-- debugging keymaps
vim.keymap.set("n", "<F5>", dap.continue, { noremap = true, silent = true })
vim.keymap.set("n", "<F9>", dap.toggle_breakpoint, { noremap = true, silent = true })
vim.keymap.set("n", "<F10>", dap.step_over, { noremap = true, silent = true })
vim.keymap.set("n", "<F11>", dap.step_into, { noremap = true, silent = true })
vim.keymap.set("n", "<S-F11>", dap.step_out, { noremap = true, silent = true })
vim.keymap.set("n", "<F23>", dap.step_out, { noremap = true, silent = true }) -- <Shift-F11> in kitty
vim.keymap.set("n", "<M-k>", dapui.eval, { noremap = true, silent = true })
-- trigger auto-completion in repl
vim.cmd([[
augroup TriggerDapReplAutoCompletion
autocmd!
autocmd FileType dap-repl lua require("dap.ext.autocompl").attach()
augroup END
]])
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end

View File

@ -53,8 +53,13 @@ in
nodePackages.typescript
nodePackages.dockerfile-language-server-nodejs
nodePackages.vscode-html-languageserver-bin
lldb
vscode-extensions.vadimcn.vscode-lldb
];
# symlink for a stable path
home.file.".vscode-extensions/vscode-lldb".source = pkgs.vscode-extensions.vadimcn.vscode-lldb;
programs = {
neovim = {
enable = true;
@ -115,6 +120,10 @@ in
lua-dev-nvim
null-ls-nvim
lsp_lines-nvim
# debugging
nvim-dap
nvim-dap-ui
];
extraConfig = ''
@ -146,6 +155,7 @@ in
vim.opt.background = '${theme}'
${builtins.readFile ./project-nvim.lua }
${builtins.readFile ./dap.lua }
EOF
'';
};

View File

@ -73,6 +73,11 @@ for lsp, settings in pairs(servers) do
})
end
-- setup rust tools
local codelldb_base_path = vim.env.HOME .. "/.vscode-extensions/vscode-lldb/share/vscode/extensions/vadimcn.vscode-lldb/"
local codelldb_bin_path = codelldb_base_path .. 'adapter/codelldb'
local codelldb_lib_path = codelldb_base_path .. 'lldb/lib/liblldb.so'
require("rust-tools").setup({
server = {
on_attach = on_attach,
@ -89,6 +94,9 @@ require("rust-tools").setup({
},
capabilities = capabilities,
},
dap = {
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_bin_path, codelldb_lib_path)
},
})
local luadev = require("lua-dev").setup({

View File

@ -50,7 +50,25 @@ cmp.setup({
end
end, { "i", "s" }),
}),
experimental = { ghost_text = true }
experimental = { ghost_text = true },
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
fields = { "menu", "abbr", "kind" },
format = function(entry, item)
local menu_icon = {
nvim_lsp = "λ",
luasnip = "",
buffer = "Ω",
path = "🖿",
}
item.menu = menu_icon[entry.source.name]
return item
end,
},
})
-- `/` cmdline setup.