Compare commits

..

No commits in common. "fd6d93d0cf771b877ffaa5c294bbc06a7e1814e7" and "8b88bc178a07584ef547db2a95cbdda37fb90d34" have entirely different histories.

4 changed files with 9 additions and 48 deletions

View File

@ -21,11 +21,6 @@ vim.keymap.set('n', '<leader>ff', require('telescope.builtin').find_files,
vim.keymap.set('n', '<leader>fg', require('telescope.builtin').live_grep,
{ desc = '[F]ind by [G]rep' })
-- Tabs
vim.keymap.set('n', '<leader>tt', ':tabnew<cr>')
vim.keymap.set('n', '<leader>tn', ':tabnext<cr>')
vim.keymap.set('n', '<leader>tp', ':tabprevious<cr>')
-- LSP
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition)

View File

@ -20,7 +20,7 @@ lsp_zero.format_on_save({
['tsserver'] = { 'typescript', 'javascript' },
},
})
-- LSP: go
local lspconfig = require('lspconfig')
lspconfig.gopls.setup({
settings = {
@ -33,30 +33,7 @@ lspconfig.gopls.setup({
}
}
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
local params = vim.lsp.util.make_range_params()
params.context = { only = { "source.organizeImports" } }
-- buf_request_sync defaults to a 1000ms timeout. Depending on your
-- machine and codebase, you may want longer. Add an additional
-- argument after params if you find that you have to write the file
-- twice for changes to be saved.
-- E.g., vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, 3000)
local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params)
for cid, res in pairs(result or {}) do
for _, r in pairs(res.result or {}) do
if r.edit then
local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16"
vim.lsp.util.apply_workspace_edit(r.edit, enc)
end
end
end
vim.lsp.buf.format({ async = false })
end
})
-- LSP: nix
lspconfig.nil_ls.setup({
autostart = true,
settings = {
@ -68,7 +45,6 @@ lspconfig.nil_ls.setup({
},
})
-- LSP: lua
lspconfig.lua_ls.setup({
on_init = function(client)
local path = client.workspace_folders[1].name
@ -109,7 +85,6 @@ lspconfig.lua_ls.setup({
}
})
-- LSP: ts/js
lspconfig.tsserver.setup({
init_options = {
plugins = {
@ -231,10 +206,9 @@ cmp.setup({
}),
sources = cmp.config.sources({
}, {
{ name = "copilot", group_index = 2 },
{ name = "nvim_lsp", group_index = 2 },
-- { name = "luasnip" },
-- { name = "buffer" },
{ name = "copilot", group_index = 2 },
{ name = "luasnip" },
{ name = "buffer" },
})
})

View File

@ -56,9 +56,7 @@
typescript
# Py stuff
(unstable.python312.withPackages (p: with p; [
requests
]))
python3
poetry
ruff

View File

@ -11,6 +11,7 @@ let
retval=$?
if [ $retval -ne 0 ]; then
echo "Failed to send notification"
exit 1
fi
# Do the backup
@ -18,18 +19,11 @@ let
${pkgs.restic}/bin/restic backup /home/torjus \
--exclude '/home/torjus/.cache' \
--exclude '/home/torjus/.local/share/Steam' \
--exclude '/home/torjus/.local/share/containers' \
--exclude '/home/torjus/git/nixpkgs'
retval=$?
if [ $retval -ne 0 ]; then
${pkgs.libnotify}/bin/notify-send -u critical "Backup failed" "Backup of /home/torjus failed"
retval=$?
if [ $retval -ne 0 ]; then
# TODO: put token in sops
${pkgs.curl}/bin/curl "https://gotify.t-juice.club/message?token=ABgV8XT62bxyCzF" \
-F "title=Backup of home@gunter failed!" \
-F "message=Please check status of backup-home service"
fi
notify-send -u critical "Backup failed" "Backup of /home/torjus failed"
exit 1
fi
# Remove old snapshots and prune
@ -54,7 +48,7 @@ let
retval=$?
if [ $retval -ne 0 ]; then
echo "Failed to send notification"
exit $retval
exit 1
fi
'';
in