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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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