refactor: run nixfmt-tree and deadnix

This commit is contained in:
2026-02-08 10:11:47 +01:00
parent 643dc4bae9
commit 96c865443e
18 changed files with 442 additions and 427 deletions

View File

@@ -1,29 +1,29 @@
{ ... }: { ... }:
{ {
plugins = { plugins = {
lspkind.enable = true; lspkind.enable = true;
cmp-nvim-lsp-signature-help.enable = true; cmp-nvim-lsp-signature-help.enable = true;
cmp = { cmp = {
enable = true; enable = true;
autoEnableSources = true; autoEnableSources = true;
settings = { settings = {
sources = [ sources = [
{ name = "nvim_lsp"; } { name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; } { name = "nvim_lsp_signature_help"; }
{ name = "path"; } { name = "path"; }
{ name = "buffer"; } { name = "buffer"; }
{ name = "dap"; } { name = "dap"; }
]; ];
mapping = { mapping = {
"<Tab>" = "cmp.mapping.select_next_item()"; "<Tab>" = "cmp.mapping.select_next_item()";
"<S-Tab>" = "cmp.mapping.select_prev_item()"; "<S-Tab>" = "cmp.mapping.select_prev_item()";
"<C-j>" = "cmp.mapping.scroll_docs(4)"; "<C-j>" = "cmp.mapping.scroll_docs(4)";
"<C-k>" = "cmp.mapping.scroll_docs(-4)"; "<C-k>" = "cmp.mapping.scroll_docs(-4)";
"<C-Space>" = "cmp.mapping.complete()"; "<C-Space>" = "cmp.mapping.complete()";
"<C-Esc>" = "cmp.mapping.close()"; "<C-Esc>" = "cmp.mapping.close()";
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; "<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
}; };
}; };
}; };
}; };
} }

View File

@@ -1,22 +1,22 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
./opts.nix ./opts.nix
./lsp.nix ./lsp.nix
./cmp.nix ./cmp.nix
./keymaps.nix ./keymaps.nix
./plugins ./plugins
]; ];
colorschemes.catppuccin.enable = true; colorschemes.catppuccin.enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
wl-clipboard wl-clipboard
]; ];
clipboard = { clipboard = {
register = "unnamedplus"; register = "unnamedplus";
providers.wl-copy.enable = true; providers.wl-copy.enable = true;
providers.wl-copy.package = pkgs.wl-clipboard; providers.wl-copy.package = pkgs.wl-clipboard;
providers.xclip.enable = true; providers.xclip.enable = true;
providers.xclip.package = pkgs.xclip; providers.xclip.package = pkgs.xclip;
}; };
} }

View File

@@ -1,168 +1,174 @@
{ ... }: { ... }:
{ {
keymaps = [ keymaps = [
{ {
action = ":bnext<CR>"; action = ":bnext<CR>";
key = "<A-l>"; key = "<A-l>";
options = { options = {
silent = true; silent = true;
desc = "Next tab"; desc = "Next tab";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":bprevious<CR>"; action = ":bprevious<CR>";
key = "<A-h>"; key = "<A-h>";
options = { options = {
silent = true; silent = true;
desc = "Previous tab"; desc = "Previous tab";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":bdelete<CR>"; action = ":bdelete<CR>";
key = "<S-q>"; key = "<S-q>";
options = { options = {
silent = true; silent = true;
desc = "Next tab"; desc = "Next tab";
}; };
mode = "n"; mode = "n";
} }
{ {
action = "<C-\\><C-n>"; action = "<C-\\><C-n>";
key = "<Esc>"; key = "<Esc>";
options = { options = {
silent = true; silent = true;
desc = "Exit terminal insert mode"; desc = "Exit terminal insert mode";
}; };
mode = "t"; mode = "t";
} }
{ {
action = ":w<CR>"; action = ":w<CR>";
key = "<C-s>"; key = "<C-s>";
options = { options = {
silent = true; silent = true;
desc = "Save"; desc = "Save";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":lua vim.lsp.buf.format()<CR>"; action = ":lua vim.lsp.buf.format()<CR>";
key = "<C-f>"; key = "<C-f>";
options = { options = {
silent = true; silent = true;
desc = "Format buffer"; desc = "Format buffer";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":q<CR>"; action = ":q<CR>";
key = "<C-q>"; key = "<C-q>";
options = { options = {
silent = true; silent = true;
desc = "Quit"; desc = "Quit";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":wincmd l<CR>"; action = ":wincmd l<CR>";
key = "<Space>wl"; key = "<Space>wl";
options = { options = {
silent = true; silent = true;
desc = "Go to left panel"; desc = "Go to left panel";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":wincmd k<CR>"; action = ":wincmd k<CR>";
key = "<Space>wk"; key = "<Space>wk";
options = { options = {
silent = true; silent = true;
desc = "Go to upper panel"; desc = "Go to upper panel";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":wincmd j<CR>"; action = ":wincmd j<CR>";
key = "<Space>wj"; key = "<Space>wj";
options = { options = {
silent = true; silent = true;
desc = "Go to down panel"; desc = "Go to down panel";
}; };
mode = "n"; mode = "n";
} }
{ {
action = ":wincmd h<CR>"; action = ":wincmd h<CR>";
key = "<Space>wh"; key = "<Space>wh";
options = { options = {
silent = true; silent = true;
desc = "Go to left panel"; desc = "Go to left panel";
}; };
mode = "n"; mode = "n";
} }
{ {
action = "$"; action = "$";
key = "gl"; key = "gl";
options = { options = {
silent = true; silent = true;
desc = "Go to end line"; desc = "Go to end line";
}; };
mode = [ "n" "v" ]; mode = [
} "n"
{ "v"
action = "^"; ];
key = "gh"; }
options = { {
silent = true; action = "^";
desc = "Go to start line"; key = "gh";
}; options = {
mode = [ "n" "v" ]; silent = true;
} desc = "Go to start line";
{ };
action = ":lua Snacks.explorer()<CR>"; mode = [
key = "<Space>e"; "n"
options = { "v"
silent = true; ];
desc = "Toggle file explorer"; }
}; {
mode = "n"; action = ":lua Snacks.explorer()<CR>";
} key = "<Space>e";
# ToggleTerm options = {
{ silent = true;
action = ":ToggleTerm direction=float<CR>"; desc = "Toggle file explorer";
key = "<Space>t"; };
options = { mode = "n";
silent = true; }
desc = "Toggle terminal"; # ToggleTerm
}; {
mode = "n"; action = ":ToggleTerm direction=float<CR>";
} key = "<Space>t";
# Dap options = {
{ silent = true;
action.__raw = '' desc = "Toggle terminal";
function() };
require("dap").toggle_breakpoint() mode = "n";
end }
''; # Dap
key = "<Space>b"; {
mode = "n"; action.__raw = ''
options = { function()
silent = true; require("dap").toggle_breakpoint()
desc = "Toggle breakpoint"; end
}; '';
} key = "<Space>b";
{ mode = "n";
action.__raw = '' options = {
function() silent = true;
require("dapui").toggle() desc = "Toggle breakpoint";
end };
''; }
key = "<Space>y"; {
mode = "n"; action.__raw = ''
options = { function()
silent = true; require("dapui").toggle()
desc = "Toggle debugger"; end
}; '';
} key = "<Space>y";
]; mode = "n";
options = {
silent = true;
desc = "Toggle debugger";
};
}
];
} }

View File

@@ -1,36 +1,36 @@
{ ... }: { ... }:
{ {
plugins.lsp = { plugins.lsp = {
enable = true; enable = true;
servers = { servers = {
clangd.enable = true; clangd.enable = true;
nil_ls.enable = true; nil_ls.enable = true;
gopls.enable = true; gopls.enable = true;
jdtls.enable = true; jdtls.enable = true;
lua_ls.enable = true; lua_ls.enable = true;
rust_analyzer = { rust_analyzer = {
enable = true; enable = true;
installCargo = false; installCargo = false;
installRustc = false; installRustc = false;
installRustfmt = false; installRustfmt = false;
}; };
zls.enable = true; zls.enable = true;
nim_langserver.enable = true; nim_langserver.enable = true;
pyright.enable = true; pyright.enable = true;
emmet_language_server.enable = true; emmet_language_server.enable = true;
ts_ls.enable = true; ts_ls.enable = true;
docker_compose_language_service.enable = true; docker_compose_language_service.enable = true;
jsonls.enable = true; jsonls.enable = true;
phpactor.enable = true; phpactor.enable = true;
gleam.enable = true; gleam.enable = true;
elixirls.enable = true; elixirls.enable = true;
}; };
keymaps = { keymaps = {
lspBuf = { lspBuf = {
"<Space>k" = "hover"; "<Space>k" = "hover";
"<Space>r" = "rename"; "<Space>r" = "rename";
"<Space>a" = "code_action"; "<Space>a" = "code_action";
}; };
}; };
}; };
} }

View File

@@ -1,17 +1,17 @@
{ ... }: { ... }:
{ {
opts = { opts = {
number = true; number = true;
relativenumber = true; relativenumber = true;
signcolumn = "yes"; signcolumn = "yes";
splitright = true; splitright = true;
splitbelow = true; splitbelow = true;
cursorline = true; cursorline = true;
scrolloff = 5; scrolloff = 5;
undofile = true; undofile = true;
ignorecase = true; ignorecase = true;
smartcase = true; smartcase = true;
gdefault = true; gdefault = true;
termguicolors = true; termguicolors = true;
}; };
} }

View File

@@ -1,14 +1,14 @@
{ ... }: { ... }:
{ {
plugins.comment = { plugins.comment = {
enable = true; enable = true;
settings = { settings = {
sticky = true; sticky = true;
toggler = { toggler = {
block = "<C-x>"; block = "<C-x>";
line = "<C-c>"; line = "<C-c>";
}; };
}; };
}; };
} }

View File

@@ -1,66 +1,66 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
plugins = { plugins = {
dap = { dap = {
enable = true; enable = true;
adapters = { adapters = {
executables = { executables = {
gdb = { gdb = {
command = "gdb"; command = "gdb";
args = [ args = [
"-i" "-i"
"dap" "dap"
]; ];
}; };
lldb = { lldb = {
command = "lldb"; command = "lldb";
}; };
}; };
servers = { servers = {
codelldb = { codelldb = {
port = 13000; port = 13000;
executable = { executable = {
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb"; command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
args = [ args = [
"--port" "--port"
"13000" "13000"
]; ];
}; };
}; };
}; };
}; };
configurations = { configurations = {
cpp = [ cpp = [
{ {
name = "Launch GDB"; name = "Launch GDB";
type = "gdb"; type = "gdb";
request = "launch"; request = "launch";
program.__raw = '' program.__raw = ''
function() function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end''; end'';
} }
{ {
name = "Launch LLDB"; name = "Launch LLDB";
type = "lldb"; type = "lldb";
request = "launch"; request = "launch";
program.__raw = '' program.__raw = ''
function() function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end''; end'';
} }
{ {
name = "Launch CodeLLDB"; name = "Launch CodeLLDB";
type = "codelldb"; type = "codelldb";
request = "launch"; request = "launch";
program.__raw = '' program.__raw = ''
function() function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end''; end'';
} }
]; ];
}; };
}; };
dap-ui.enable = true; dap-ui.enable = true;
}; };
} }

View File

@@ -1,20 +1,20 @@
{ ... }: { ... }:
{ {
plugins.dashboard = { plugins.dashboard = {
enable = true; enable = true;
settings.config = { settings.config = {
header = [ header = [
" " " "
" " " "
" " " "
" " " "
" " " "
" " " "
" " " "
" " " "
" " " "
]; ];
footer = [ "Made with " ]; footer = [ "Made with " ];
}; };
}; };
} }

View File

@@ -1,27 +1,27 @@
{ pkgs, ... }: { ... }:
{ {
imports = [ imports = [
./comment.nix ./comment.nix
./dap.nix ./dap.nix
./dashboard.nix ./dashboard.nix
./fidget.nix ./fidget.nix
./guess-indent.nix ./guess-indent.nix
./lualine.nix ./lualine.nix
./snacks.nix ./snacks.nix
./telescope.nix ./telescope.nix
./treesitter.nix ./treesitter.nix
./vimwiki.nix ./vimwiki.nix
]; ];
plugins = { plugins = {
autoclose.enable = true; autoclose.enable = true;
bufferline.enable = true; bufferline.enable = true;
colorful-menu.enable = true; colorful-menu.enable = true;
gitsigns.enable = true; gitsigns.enable = true;
nix-develop.enable = true; nix-develop.enable = true;
nvim-surround.enable = true; nvim-surround.enable = true;
toggleterm.enable = true; toggleterm.enable = true;
web-devicons.enable = true; web-devicons.enable = true;
which-key.enable = true; which-key.enable = true;
}; };
} }

View File

@@ -1,10 +1,10 @@
{ {
plugins.fidget = { plugins.fidget = {
enable = true; enable = true;
settings.progress = { settings.progress = {
suppress_on_insert = true; suppress_on_insert = true;
ignore_done_already = true; ignore_done_already = true;
poll_rate = 1; poll_rate = 1;
}; };
}; };
} }

View File

@@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
plugins.guess-indent = { plugins.guess-indent = {
enable = true; enable = true;
}; };
} }

View File

@@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
plugins.lualine = { plugins.lualine = {
enable = true; enable = true;
}; };
} }

View File

@@ -1,11 +1,11 @@
{ ... }: { ... }:
{ {
plugins.snacks = { plugins.snacks = {
enable = true; enable = true;
settings = { settings = {
explorer = { explorer = {
enabled = true; enabled = true;
}; };
}; };
}; };
} }

View File

@@ -1,10 +1,10 @@
{ ... }: { ... }:
{ {
plugins.telescope = { plugins.telescope = {
enable = true; enable = true;
keymaps = { keymaps = {
"<Space>f" = "find_files"; "<Space>f" = "find_files";
"<Space>g" = "live_grep"; "<Space>g" = "live_grep";
}; };
}; };
} }

View File

@@ -1,11 +1,11 @@
{ ... }: { ... }:
{ {
plugins.treesitter = { plugins.treesitter = {
enable = true; enable = true;
settings = { settings = {
highlight = { highlight = {
enable = true; enable = true;
}; };
}; };
}; };
} }

View File

@@ -1,16 +1,16 @@
{ ... }: { ... }:
{ {
plugins.vimwiki = { plugins.vimwiki = {
enable = true; enable = true;
settings = { settings = {
list = [ list = [
{ {
path = "$HOME/.vimwiki/"; path = "$HOME/.vimwiki/";
template_path = "$HOME/.vimwiki/"; template_path = "$HOME/.vimwiki/";
template_default = "default"; template_default = "default";
template_ext = "html"; template_ext = "html";
} }
]; ];
}; };
}; };
} }

View File

@@ -6,9 +6,18 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, nixvim, flake-utils, ... }@inputs: outputs =
let config = import ./config; # import the module directly {
in flake-utils.lib.eachDefaultSystem (system: nixpkgs,
nixvim,
flake-utils,
...
}:
let
config = import ./config; # import the module directly
in
flake-utils.lib.eachDefaultSystem (
system:
let let
nixvimLib = nixvim.lib.${system}; nixvimLib = nixvim.lib.${system};
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
@@ -34,5 +43,6 @@
}; };
devShells.default = import ./shell.nix { inherit pkgs; }; devShells.default = import ./shell.nix { inherit pkgs; };
}); }
);
} }

View File

@@ -6,4 +6,3 @@ pkgs.mkShell {
git git
]; ];
} }