2024-11-29 02:41:01 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
|
|
nixvim = import (
|
|
|
|
builtins.fetchGit {
|
|
|
|
url = "https://github.com/nix-community/nixvim";
|
2024-12-01 18:42:45 +02:00
|
|
|
ref = "nixos-24.11";
|
2024-11-29 02:41:01 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
in
|
2024-05-23 13:39:48 +03:00
|
|
|
{
|
2024-06-02 16:18:19 +03:00
|
|
|
#################### Git configuration ####################
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
lfs.enable = true;
|
|
|
|
config = {
|
|
|
|
user = {
|
|
|
|
email = "vili.m.sinerva@gmail.com";
|
|
|
|
name = "Vili Sinervä";
|
2024-10-17 02:08:55 +03:00
|
|
|
signingkey = "DF8FEAF54EFAC996!";
|
2024-06-02 16:18:19 +03:00
|
|
|
};
|
|
|
|
merge = {
|
|
|
|
ff = "true";
|
|
|
|
};
|
|
|
|
pull = {
|
|
|
|
ff = "only";
|
|
|
|
};
|
2024-12-10 22:40:02 +02:00
|
|
|
commit = {
|
|
|
|
verbose = "true";
|
|
|
|
};
|
2024-06-02 16:18:19 +03:00
|
|
|
commit.gpgsign = "true";
|
2024-06-02 05:53:39 +03:00
|
|
|
};
|
|
|
|
};
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2024-06-02 16:18:19 +03:00
|
|
|
#################### Packages ####################
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
nixfmt-rfc-style
|
2024-10-04 12:03:23 +03:00
|
|
|
nixd
|
2024-06-02 16:18:19 +03:00
|
|
|
];
|
|
|
|
|
2024-12-16 17:39:37 +02:00
|
|
|
fonts.packages = with pkgs; [
|
|
|
|
nerdfonts
|
|
|
|
];
|
|
|
|
|
2024-06-02 16:18:19 +03:00
|
|
|
#################### Neovim configuration ####################
|
2024-11-29 02:41:01 +02:00
|
|
|
imports = [ nixvim.nixosModules.nixvim ];
|
|
|
|
|
|
|
|
programs.nixvim = {
|
2024-06-02 16:18:19 +03:00
|
|
|
enable = true;
|
|
|
|
defaultEditor = true;
|
|
|
|
vimAlias = true;
|
2024-11-29 02:41:01 +02:00
|
|
|
colorschemes.vscode.enable = true;
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-11-29 02:41:01 +02:00
|
|
|
globals.mapleader = " ";
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-11-29 02:41:01 +02:00
|
|
|
opts = {
|
|
|
|
colorcolumn = "100";
|
|
|
|
cursorline = true;
|
|
|
|
number = true;
|
|
|
|
showcmd = true;
|
|
|
|
signcolumn = "yes";
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-11-29 02:41:01 +02:00
|
|
|
scrolloff = 16;
|
|
|
|
shiftwidth = 3;
|
|
|
|
tabstop = 3;
|
|
|
|
};
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-11-29 02:41:01 +02:00
|
|
|
keymaps = [
|
2024-12-16 17:39:37 +02:00
|
|
|
{
|
|
|
|
key = "T";
|
|
|
|
action = "<cmd>Neotree<cr>";
|
2025-01-04 16:03:02 +02:00
|
|
|
options.desc = "Open Neotree";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mode = [
|
|
|
|
"i"
|
|
|
|
"v"
|
|
|
|
];
|
|
|
|
key = "<C-c>";
|
|
|
|
action = "<Esc>";
|
|
|
|
options.desc = "Exit To Normal Mode";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "<leader>b";
|
|
|
|
action = "<cmd>Gitsigns toggle_current_line_blame<cr>";
|
|
|
|
options.desc = "Toggle Current Line Git Blame";
|
2024-12-16 17:39:37 +02:00
|
|
|
}
|
2024-11-29 02:41:01 +02:00
|
|
|
];
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-11-29 02:41:01 +02:00
|
|
|
plugins = {
|
2024-12-20 01:55:38 +02:00
|
|
|
fugitive.enable = true;
|
2025-01-02 15:32:19 +02:00
|
|
|
gitsigns = {
|
2024-11-29 02:41:01 +02:00
|
|
|
enable = true;
|
2025-01-02 15:32:19 +02:00
|
|
|
settings = {
|
|
|
|
current_line_blame_opts.delay = 100;
|
|
|
|
numhl = true;
|
|
|
|
};
|
2024-11-29 02:41:01 +02:00
|
|
|
};
|
2025-01-02 15:32:19 +02:00
|
|
|
lualine.enable = true;
|
2024-11-29 02:41:01 +02:00
|
|
|
markdown-preview.enable = true;
|
2025-01-02 15:32:19 +02:00
|
|
|
neo-tree = {
|
|
|
|
enable = true;
|
|
|
|
buffers.followCurrentFile = {
|
|
|
|
enabled = true;
|
|
|
|
leaveDirsOpen = true;
|
|
|
|
};
|
|
|
|
};
|
2024-11-29 02:41:01 +02:00
|
|
|
nix.enable = true;
|
|
|
|
rainbow-delimiters.enable = true;
|
|
|
|
sleuth.enable = true;
|
|
|
|
tmux-navigator = {
|
|
|
|
enable = true;
|
2024-12-01 18:42:45 +02:00
|
|
|
settings.no_mappings = 1;
|
2025-01-02 15:32:19 +02:00
|
|
|
keymaps = [
|
|
|
|
{
|
|
|
|
key = "<C-h>";
|
|
|
|
action = "left";
|
2025-01-03 18:45:52 +02:00
|
|
|
options.desc = "Tmux Left";
|
2025-01-02 15:32:19 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "<C-j>";
|
|
|
|
action = "down";
|
2025-01-03 18:45:52 +02:00
|
|
|
options.desc = "Tmux Down";
|
2025-01-02 15:32:19 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "<C-k>";
|
|
|
|
action = "up";
|
2025-01-03 18:45:52 +02:00
|
|
|
options.desc = "Tmux Up";
|
2025-01-02 15:32:19 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "<C-l>";
|
|
|
|
action = "right";
|
2025-01-03 18:45:52 +02:00
|
|
|
options.desc = "Tmux Right";
|
2025-01-02 15:32:19 +02:00
|
|
|
}
|
|
|
|
];
|
2024-11-29 02:41:01 +02:00
|
|
|
};
|
|
|
|
treesitter = {
|
|
|
|
enable = true;
|
|
|
|
folding = true;
|
2024-12-01 18:42:45 +02:00
|
|
|
settings.indent.enable = true;
|
2024-11-29 02:41:01 +02:00
|
|
|
nixGrammars = true;
|
|
|
|
};
|
2024-12-16 17:39:37 +02:00
|
|
|
web-devicons.enable = true;
|
2025-01-02 15:32:19 +02:00
|
|
|
which-key = {
|
|
|
|
enable = true;
|
2025-01-02 15:59:37 +02:00
|
|
|
settings.delay.__raw = ''
|
|
|
|
function(ctx)
|
2025-01-02 16:06:35 +02:00
|
|
|
return ctx.plugin and 0 or 500
|
2025-01-02 15:59:37 +02:00
|
|
|
end
|
|
|
|
'';
|
2025-01-02 15:32:19 +02:00
|
|
|
};
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-12-20 01:20:48 +02:00
|
|
|
cmp = {
|
|
|
|
enable = true;
|
2024-12-20 01:45:45 +02:00
|
|
|
settings = {
|
|
|
|
sources = [
|
|
|
|
{ name = "vim-vsnip"; }
|
2024-12-20 01:55:38 +02:00
|
|
|
{ name = "vim-lsp-signature-help"; }
|
|
|
|
{ name = "nvim-lsp"; }
|
2024-12-20 01:45:45 +02:00
|
|
|
{ name = "treesitter"; }
|
2024-12-20 01:55:38 +02:00
|
|
|
{ name = "buffer"; }
|
2024-12-20 01:45:45 +02:00
|
|
|
];
|
|
|
|
mapping = {
|
|
|
|
"<C-Space>" = "cmp.mapping.complete()";
|
|
|
|
"<C-e>" = "cmp.mapping.close()";
|
|
|
|
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
2024-12-20 01:55:38 +02:00
|
|
|
"<C-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
2024-12-20 01:45:45 +02:00
|
|
|
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
|
|
|
};
|
|
|
|
};
|
2024-12-20 01:20:48 +02:00
|
|
|
};
|
2024-11-29 02:41:01 +02:00
|
|
|
friendly-snippets.enable = true;
|
|
|
|
nvim-autopairs.enable = true;
|
2024-06-02 16:18:19 +03:00
|
|
|
|
2024-11-29 02:41:01 +02:00
|
|
|
lsp = {
|
|
|
|
enable = true;
|
2025-01-04 16:03:02 +02:00
|
|
|
inlayHints = true;
|
2024-11-29 02:41:01 +02:00
|
|
|
keymaps = {
|
|
|
|
diagnostic = {
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>dj" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "goto_next";
|
|
|
|
desc = "Next Diagnostic";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>dk" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "goto_prev";
|
|
|
|
desc = "Previous Diagnostic";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>dh" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "open_float";
|
|
|
|
desc = "Line Diagnostics";
|
|
|
|
};
|
2024-11-29 02:41:01 +02:00
|
|
|
};
|
|
|
|
lspBuf = {
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>gd" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "definition";
|
|
|
|
desc = "Goto Definition";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>gr" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "references";
|
|
|
|
desc = "Goto References";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>gD" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "declaration";
|
|
|
|
desc = "Goto Declaration";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>gi" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "implementation";
|
|
|
|
desc = "Goto Implementation";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>gt" = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "type_definition";
|
|
|
|
desc = "Type Definition";
|
|
|
|
};
|
2025-01-04 17:41:19 +02:00
|
|
|
"<leader>s" = {
|
|
|
|
action = "workspace_symbol";
|
|
|
|
desc = "Search Symbol";
|
|
|
|
};
|
|
|
|
"<leader>r" = {
|
|
|
|
action = "rename";
|
|
|
|
desc = "Rename Symbol";
|
|
|
|
};
|
|
|
|
"<leader>a" = {
|
|
|
|
action = "code_action";
|
|
|
|
desc = "Code Action";
|
|
|
|
};
|
|
|
|
H = {
|
2025-01-03 18:45:52 +02:00
|
|
|
action = "hover";
|
|
|
|
desc = "Hover";
|
|
|
|
};
|
2024-11-29 02:41:01 +02:00
|
|
|
};
|
2025-01-04 16:03:02 +02:00
|
|
|
extra = [
|
|
|
|
{
|
2025-01-04 16:18:12 +02:00
|
|
|
action = "<cmd>lua vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())<cr>";
|
|
|
|
key = "<leader>h";
|
2025-01-04 16:03:02 +02:00
|
|
|
options.desc = "Toggle LSP Inlay Hints";
|
|
|
|
}
|
|
|
|
];
|
2024-11-29 02:41:01 +02:00
|
|
|
};
|
|
|
|
servers = {
|
|
|
|
clangd.enable = true;
|
|
|
|
cmake.enable = true;
|
|
|
|
dockerls.enable = true;
|
2024-12-01 18:42:45 +02:00
|
|
|
docker_compose_language_service.enable = true;
|
2024-11-29 02:41:01 +02:00
|
|
|
eslint.enable = true;
|
|
|
|
html.enable = true;
|
|
|
|
jsonls.enable = true;
|
|
|
|
nixd.enable = true;
|
|
|
|
pylsp.enable = true;
|
2024-12-01 18:42:45 +02:00
|
|
|
rust_analyzer = {
|
2024-11-29 02:41:01 +02:00
|
|
|
enable = true;
|
|
|
|
installCargo = true;
|
|
|
|
installRustc = true;
|
2025-01-18 12:50:27 +02:00
|
|
|
settings = {
|
|
|
|
completion = {
|
|
|
|
autoimport.enable = true;
|
|
|
|
autoself.enable = true;
|
|
|
|
fullFunctionSignatures.enable = true;
|
|
|
|
privateEditable.enable = true;
|
|
|
|
};
|
|
|
|
diagnostics = {
|
|
|
|
styleLints.enable = true;
|
|
|
|
};
|
|
|
|
hover.actions.references.enable = true;
|
|
|
|
};
|
2024-11-29 02:41:01 +02:00
|
|
|
};
|
|
|
|
yamlls.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
lsp-format.enable = true;
|
2025-01-04 16:03:02 +02:00
|
|
|
lsp-signature.enable = true;
|
2024-06-02 16:18:19 +03:00
|
|
|
};
|
2024-06-02 05:53:39 +03:00
|
|
|
};
|
2024-06-02 16:18:19 +03:00
|
|
|
}
|