update nixvim config

This commit is contained in:
2026-07-31 01:20:08 +02:00
parent 0b73b99654
commit ee0447931e
7 changed files with 305 additions and 30 deletions
+11 -1
View File
@@ -139,6 +139,7 @@ in
"networkmanager"
"wheel"
"docker"
"audio"
];
shell = pkgs.fish;
};
@@ -176,7 +177,7 @@ in
services.lact.enable = true;
services.rsync.enable = true;
programs.kdeconnect.enable = true;
# programs.neovim.enable = true;
programs.neovim.enable = true;
programs.tmux.enable = true;
programs.bat.enable = true;
programs.git = {
@@ -245,10 +246,19 @@ in
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
services.pipewire.extraConfig.pipewire."92-clock-quantum" = {
"context.properties" = {
"default.clock.quantum" = 2048;
"default.clock.min-quantum" = 256;
"default.clock.max-quantum" = 4096;
};
};
security.pam.loginLimits = [
{
domain = "@users";
+12
View File
@@ -9,6 +9,10 @@
action = "<cmd>lua Snacks.explorer.open()<CR>";
key = "<leader>e";
}
{
action = "<cmd>lua Snacks.bufdelete()<CR>";
key = "<C-q>";
}
{
mode = [
"n"
@@ -18,6 +22,14 @@
action = ''<cmd>lua require("flash").jump()<CR>'';
key = "s";
}
{
action = "<cmd>BufferLineCycleNext<CR>";
key = "<tab>";
}
{
action = "<cmd>BufferLineCyclePrev<CR>";
key = "<S-tab>";
}
];
};
}
+28
View File
@@ -0,0 +1,28 @@
{
programs.nixvim.lsp = {
servers = {
lua_ls.enable = true;
nixd = {
enable = true;
config = {
nixd = {
nixpkgs = {
expr = ''import (builtins.getFlake "/home/user/nix-config").inputs.nixpkgs { }'';
};
formatting = {
command = "nixfmt";
};
options = {
nixos = {
expr = ''(builtins.getFlake "/home/user/nix-config").nixosConfigurations.desktop.options'';
};
home_manager = {
expr = ''(builtins.getFlake "/home/user/nix-config").nixosConfigurations.desktop.options.home-manager.users.type.getSubOptions []'';
};
};
};
};
};
};
};
}
+132 -29
View File
@@ -1,64 +1,167 @@
{ nixvim, pkgs, ... }:
{
nixvim,
pkgs,
...
}:
{
imports = [
nixvim.nixosModules.nixvim
./plugins
./keymaps.nix
./lsp.nix
];
programs.nixvim = {
enable = true;
enable = false;
defaultEditor = true;
clipboard.register = "unnamedplus";
colorschemes.tokyonight = {
opts = {
number = true;
relativenumber = true;
expandtab = true;
shiftwidth = 2;
smartindent = true;
tabstop = 2;
softtabstop = 2;
fillchars.eob = " ";
ignorecase = true;
smartcase = true;
mouse = "a";
};
# colorschemes.nightfox = {
# enable = true;
# settings = {
# # style = "moon";
# flavor = "carbonfox";
# options.transparent = true;
# styles = {
# sidebars = "transparent";
# floats = "transparent";
# };
# };
# };
colorschemes.base16 = {
enable = true;
settings = {
transparent = true;
base00 = "11121d";
base01 = "282934";
base02 = "353747"; # slightly lighter than base01 (or reuse 282934)
base03 = "565b6b"; # comment color; you'll probably want to tweak this
base04 = "abb2bf";
base05 = "abb2bf";
base06 = "b2b9c6";
base07 = "ffffff";
base08 = "ee6d85";
base09 = "f3627a";
base0A = "dfae67";
base0B = "95c561";
base0C = "a485dd"; # no cyan in your palette, so purple works
base0D = "7199ee";
base0E = "a485dd";
base0F = "f3627a";
};
};
extraPlugins = [ pkgs.vimPlugins.boole-nvim ];
extraConfigLua = ''
require('boole').setup({
mappings = {
-- increment = '<C-a>',
decrement = '<C-x>'
},
allow_caps_additions = {
{'enable', 'disable'},
{'true', 'false'}
}
})
'';
plugins = {
lualine.enable = true;
bufferline.enable = true;
bufferline = {
enable = true;
settings = {
options = {
show_buffer_close_icons = false;
show_close_icon = false;
};
};
};
yazi.enable = true;
cord = {
enable = true;
settings.display.theme = "atom";
};
neoscroll.enable = true;
snacks = {
telescope = {
enable = true;
settings = {
bigfile.enabled = true;
dashboard.enabled = true;
explorer = {
enabled = true;
auto_close = true;
};
indent.enabled = false;
input.enabled = true;
picker.enabled = true;
notifier.enabled = true;
quickfile.enabled = true;
statuscolumn.enabled = true;
words.enabled = true;
};
enabledExtensions = [ "persisted" ];
};
telescope.enable = true;
which-key.enable = true;
flash.enable = true;
lsp.enable = true;
};
lsp = {
servers = {
lua_ls.enable = true;
nixd.enable = true;
fugitive.enable = true;
treesitter = {
enable = true;
highlight.enable = true;
indent.enable = true;
settings.ensure_installed = "all";
};
gitsigns.enable = true;
nvim-autopairs = {
enable = true;
};
cmp = {
autoEnableSources = true;
settings.sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
};
persisted.enable = true;
render-markdown.enable = true;
transparent = {
enable = true;
autoLoad = true;
settings = {
groups = [
"Normal"
"NormalNC"
"Comment"
"Constant"
"Special"
"Identifier"
"Statement"
"PreProc"
"Type"
"Underlined"
"Todo"
"String"
"Function"
"Conditional"
"Repeat"
"Operator"
"Structure"
"LineNr"
"NonText"
"SignColumn"
"CursorLine"
"CursorLineNr"
"StatusLine"
"StatusLineNC"
"EndOfBuffer"
];
};
};
inlayHints.enable = true;
};
};
@@ -0,0 +1,35 @@
{ pkgs, ... }:
{
programs.nixvim.extraPackages = with pkgs; [
stylua
nixfmt
];
programs.nixvim.plugins = {
conform-nvim = {
enable = true;
settings = {
format_on_save = ''
function(bufnr)
-- Disable "format_on_save lsp_fallback" for lanuages that don't
-- have a well standardized coding style. You can add additional
-- lanuages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
return {
timeout_ms = 500,
lsp_format = "fallback",
}
end
end
'';
formatters_by_ft = {
lua = [ "stylua" ];
nix = [ "nixfmt" ];
};
};
};
};
}
@@ -0,0 +1,6 @@
{
imports = [
./snacks.nix
./conform.nix
];
}
@@ -0,0 +1,81 @@
{
programs.nixvim.plugins = {
snacks = {
enable = true;
settings = {
bigfile.enabled = true;
dashboard = {
enabled = true;
preset = {
keys = [
{
icon = " ";
key = "f";
desc = "Find File";
action = ":lua Snacks.dashboard.pick('files')";
}
{
icon = " ";
key = "n";
desc = "New File";
action = ":ene | startinsert";
}
{
icon = " ";
key = "g";
desc = "Find Text";
action = ":lua Snacks.dashboard.pick('live_grep')";
}
{
icon = " ";
key = "r";
desc = "Recent Files";
action = ":lua Snacks.dashboard.pick('oldfiles')";
}
{
icon = " ";
key = "c";
desc = "Config";
action = ":lua require('telescope.builtin').find_files({ cwd = '~/nix-config/modules/programs/neovim' })";
}
{
icon = " ";
key = "s";
desc = "Restore Session";
action = ":Telescope persisted";
}
{
icon = " ";
key = "q";
desc = "Quit";
action = ":qa";
}
];
};
sections = [
{
section = "header";
gap = 2;
}
{
section = "keys";
gap = 1;
padding = 1;
}
];
};
explorer = {
enabled = true;
auto_close = true;
};
indent.enabled = false;
input.enabled = true;
picker.enabled = true;
notifier.enabled = true;
quickfile.enabled = true;
statuscolumn.enabled = true;
words.enabled = true;
};
};
};
}