nixos-conf/development.nix

231 lines
5.4 KiB
Nix
Raw Normal View History

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-03 18:45:52 +02:00
options = {
silent = true;
desc = "Open Neotree";
};
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
# TODO Check desireable keybinds and commands for all plugins
plugins = {
2024-12-20 01:55:38 +02:00
fugitive.enable = true;
gitsigns = {
2024-11-29 02:41:01 +02:00
enable = true;
settings = {
current_line_blame_opts.delay = 100;
numhl = true;
};
2024-11-29 02:41:01 +02:00
};
lualine.enable = true;
2024-11-29 02:41:01 +02:00
markdown-preview.enable = true;
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;
keymaps = [
{
key = "<C-h>";
action = "left";
2025-01-03 18:45:52 +02:00
options.desc = "Tmux Left";
}
{
key = "<C-j>";
action = "down";
2025-01-03 18:45:52 +02:00
options.desc = "Tmux Down";
}
{
key = "<C-k>";
action = "up";
2025-01-03 18:45:52 +02:00
options.desc = "Tmux Up";
}
{
key = "<C-l>";
action = "right";
2025-01-03 18:45:52 +02:00
options.desc = "Tmux Right";
}
];
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;
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
'';
};
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;
keymaps = {
diagnostic = {
2025-01-03 18:45:52 +02:00
"<leader>j" = {
action = "goto_next";
desc = "Next Diagnostic";
};
"<leader>k" = {
action = "goto_prev";
desc = "Previous Diagnostic";
};
"<leader>K" = {
action = "open_float";
desc = "Line Diagnostics";
};
2024-11-29 02:41:01 +02:00
};
lspBuf = {
2025-01-03 18:45:52 +02:00
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
K = {
action = "hover";
desc = "Hover";
};
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;
};
yamlls.enable = true;
};
};
lsp-format.enable = true;
2025-01-03 18:45:52 +02:00
lsp-lines.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
}