This commit is contained in:
catvayor 2024-11-28 15:44:53 +01:00
parent 6ddf07aa20
commit aff8a0aca3
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
3 changed files with 108 additions and 12 deletions

View file

@ -95,16 +95,18 @@ let
which-key = {
enable = true;
settings.triggers =
[
{
__unkeyed-1 = "<leader>";
map
(key: {
__unkeyed = key;
mode = "nxsot";
}
{
__unkeyed-1 = "f";
mode = "nxsot";
}
];
})
[
"<leader>"
"f"
"c"
"d"
"y"
];
};
todo-comments = {
@ -158,6 +160,96 @@ let
}
];
luasnip.enable = true;
cmp_luasnip.enable = true;
cmp-nvim-lsp.enable = true;
cmp-buffer.enable = true;
cmp-cmdline.enable = true;
cmp-path.enable = true;
cmp-latex-symbols.enable = true;
cmp = {
enable = true;
autoEnableSources = false;
cmdline =
let
slash-qu = {
mapping.__raw = "cmp.mapping.preset.cmdline()";
sources = [
{ name = "buffer"; }
];
};
in
{
"/" = slash-qu;
"?" = slash-qu;
":" = {
mapping.__raw = "cmp.mapping.preset.cmdline()";
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
matching = {
disallow_symbol_nonprefix_matching = false;
};
};
};
settings = {
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
sources = map (name: { inherit name; }) [
"luasnip"
"nvim_lsp"
"buffer"
] ++ [
{ name = "latex_symbols"; option.strategy = 2; }
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
"<S-Tab>" = ''
cmp.mapping(
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(
vim.api.nvim_replace_termcodes(
"<Plug>luasnip-jump-prev",
true, true, true),
"")
else
fallback()
end
end,
{'i', 's'})'';
"<Tab>" = ''
cmp.mapping(
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(
vim.api.nvim_replace_termcodes(
"<Plug>luasnip-expand-or-jump",
true, true, true),
"")
else
fallback()
end
end,
{ 'i', 's' })
'';
};
};
};
lsp-lines.enable = true;
lsp = {
@ -201,6 +293,10 @@ let
installCargo = true;
installRustc = true;
};
hls = {
enable = true;
installGhc = true;
};
};
};
};

View file

@ -10,7 +10,7 @@
imports = [
./hardware-configuration.nix
users.catvayor
# ./router.nix
./router.nix
];
fileSystems."/tmp" = {

View file

@ -1,5 +1,5 @@
{
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
{ lib, ... }: {
boot.kernel.sysctl."net.ipv4.ip_forward" = lib.mkForce true;
systemd.network = {
enable = true;