Merge pull request #24 from cnsta/neovim

Neovim
This commit is contained in:
cnsta
2024-08-19 21:25:32 +02:00
committed by GitHub
34 changed files with 866 additions and 455 deletions

View File

@@ -1,7 +1,8 @@
{ {
inputs,
config, config,
lib, lib,
inputs,
pkgs,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
@@ -9,25 +10,55 @@
in { in {
imports = [ imports = [
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
./autocommands.nix
./completion.nix
./keymappings.nix
./options.nix
./plugins ./plugins
./autocmd.nix
./completion.nix
./keymap.nix
./options.nix
./todo.nix ./todo.nix
]; ];
options = { options = {
modules.devtools.neovim.enable = mkEnableOption "Enables neovim"; modules.devtools.neovim.enable = mkEnableOption "Enable Neovim";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.nixvim = { programs.nixvim = {
extraPlugins = [pkgs.vimPlugins.gruvbox-material];
colorscheme = "gruvbox-material";
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
luaLoader.enable = true; luaLoader.enable = true;
plugins = {
gitsigns = {
enable = true;
settings.signs = {
add.text = "+";
change.text = "~";
};
};
nvim-autopairs.enable = true;
nvim-colorizer = {
enable = true;
userDefaultOptions.names = false;
};
oil.enable = true;
trim = {
enable = true;
settings = {
highlight = false;
ft_blocklist = [
"checkhealth"
"floaterm"
"lspinfo"
"neo-tree"
"TelescopePrompt"
];
};
};
};
}; };
}; };
} }

View File

@@ -0,0 +1,59 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.ai;
in
{
options = {
modules.devtools.neovim.plugins.ai.enable = mkEnableOption "Enables AI tools for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
chatgpt = {
enable = true;
settings = {
api_key_cmd = "cat ${config.sops.secrets.openai_api_key.path}";
};
};
copilot-chat.enable = true;
copilot-lua = {
enable = true;
suggestion = {
enabled = true;
autoTrigger = true;
keymap.accept = "<C-CR>";
};
panel.enabled = false;
};
};
keymaps = [
{
action = "<cmd>CopilotChatToggle<CR>";
key = "<leader>ac";
options = {
desc = "Toggle Coilot chat";
};
mode = [
"n"
];
}
{
action = "<cmd>ChatGPT<CR>";
key = "<leader>ag";
options = {
desc = "Toggle ChatGPT";
};
mode = [
"n"
];
}
];
};
};
}

View File

@@ -1,10 +1,24 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.barbar;
in
{ {
programs.nixvim.plugins.barbar = { options = {
enable = true; modules.devtools.neovim.plugins.barbar.enable = mkEnableOption "Enables Barbar plugin for Neovim";
keymaps = { };
next.key = "<TAB>";
previous.key = "<S-TAB>"; config = mkIf cfg.enable {
close.key = "<C-w>"; programs.nixvim.plugins.barbar = {
enable = true;
keymaps = {
next.key = "<TAB>";
previous.key = "<S-TAB>";
close.key = "<C-w>";
};
}; };
}; };
} }

View File

@@ -1,8 +0,0 @@
{config, ...}: {
programs.nixvim.plugins.chatgpt = {
enable = true;
settings = {
api_key_cmd = "cat ${config.sops.secrets.openai_api_key.path}";
};
};
}

View File

@@ -1,10 +1,24 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.comment;
in
{ {
programs.nixvim.plugins.comment = { options = {
enable = true; modules.devtools.neovim.plugins.comment.enable = mkEnableOption "Enables Comment plugin for Neovim";
};
settings = { config = mkIf cfg.enable {
opleader.line = "<C-b>"; programs.nixvim.plugins.comment = {
toggler.line = "<C-b>"; enable = true;
settings = {
opleader.line = "<C-b>";
toggler.line = "<C-b>";
};
}; };
}; };
} }

View File

@@ -1,24 +1,38 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.conform-nvim;
in
{ {
programs.nixvim.plugins.conform-nvim = { options = {
enable = true; modules.devtools.neovim.plugins.conform-nvim.enable = mkEnableOption "Enables Conform plugin for Neovim";
formatOnSave = { };
lspFallback = true;
timeoutMs = 500; config = mkIf cfg.enable {
}; programs.nixvim.plugins.conform-nvim = {
notifyOnError = true; enable = true;
formattersByFt = { formatOnSave = {
liquidsoap = [ "liquidsoap-prettier" ]; lspFallback = true;
html = [ [ "prettierd" "prettier" ] ]; timeoutMs = 500;
css = [ [ "prettierd" "prettier" ] ]; };
javascript = [ [ "prettierd" "prettier" ] ]; notifyOnError = true;
javascriptreact = [ [ "prettierd" "prettier" ] ]; formattersByFt = {
typescript = [ [ "prettierd" "prettier" ] ]; liquidsoap = [ "liquidsoap-prettier" ];
typescriptreact = [ [ "prettierd" "prettier" ] ]; html = [ [ "prettierd" "prettier" ] ];
python = [ "black" ]; css = [ [ "prettierd" "prettier" ] ];
lua = [ "stylua" ]; javascript = [ [ "prettierd" "prettier" ] ];
nix = [ "alejandra" ]; javascriptreact = [ [ "prettierd" "prettier" ] ];
markdown = [ [ "prettierd" "prettier" ] ]; typescript = [ [ "prettierd" "prettier" ] ];
yaml = [ "yamllint" "yamlfmt" ]; typescriptreact = [ [ "prettierd" "prettier" ] ];
python = [ "black" ];
lua = [ "stylua" ];
nix = [ "alejandra" ];
markdown = [ [ "prettierd" "prettier" ] ];
yaml = [ "yamllint" "yamlfmt" ];
};
}; };
}; };
} }

View File

@@ -1,60 +1,22 @@
{pkgs, ...}: { { userModules, ... }: {
imports = [ imports = [
./barbar.nix "${userModules}/devtools/neovim/plugins/ai.nix"
./comment.nix "${userModules}/devtools/neovim/plugins/barbar.nix"
./efm.nix "${userModules}/devtools/neovim/plugins/comment.nix"
# ./floaterm.nix "${userModules}/devtools/neovim/plugins/conform.nix"
# ./harpoon.nix "${userModules}/devtools/neovim/plugins/efm.nix"
./lsp.nix "${userModules}/devtools/neovim/plugins/floaterm.nix"
./lualine.nix "${userModules}/devtools/neovim/plugins/harpoon.nix"
./markdown-preview.nix "${userModules}/devtools/neovim/plugins/lsp.nix"
./neo-tree.nix "${userModules}/devtools/neovim/plugins/lualine.nix"
./startify.nix "${userModules}/devtools/neovim/plugins/markdown-preview.nix"
./tagbar.nix "${userModules}/devtools/neovim/plugins/neo-tree.nix"
./telescope.nix "${userModules}/devtools/neovim/plugins/nonels.nix"
./treesitter.nix "${userModules}/devtools/neovim/plugins/startify.nix"
# ./chatgpt.nix "${userModules}/devtools/neovim/plugins/tagbar.nix"
# ./vimtex.nix "${userModules}/devtools/neovim/plugins/telescope.nix"
./nonels.nix "${userModules}/devtools/neovim/plugins/treesitter.nix"
./conform.nix "${userModules}/devtools/neovim/plugins/vimtex.nix"
# ./yanky.nix "${userModules}/devtools/neovim/plugins/yanky.nix"
]; ];
programs.nixvim = {
extraPlugins = [pkgs.vimPlugins.gruvbox-material];
colorscheme = "gruvbox-material";
plugins = {
gitsigns = {
enable = true;
settings.signs = {
add.text = "+";
change.text = "~";
};
};
nvim-autopairs.enable = true;
nvim-colorizer = {
enable = true;
userDefaultOptions.names = false;
};
oil.enable = true;
trim = {
enable = true;
settings = {
highlight = false;
ft_blocklist = [
"checkhealth"
"floaterm"
"lspinfo"
"neo-tree"
"TelescopePrompt"
];
};
};
};
};
} }

View File

@@ -1,22 +1,36 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.efm;
in
{ {
programs.nixvim.plugins = { options = {
lsp.servers.efm = { modules.devtools.neovim.plugins.efm.enable = mkEnableOption "Enables EFM LSP support for Neovim";
enable = true; };
extraOptions.init_options = {
documentFormatting = true; config = mkIf cfg.enable {
documentRangeFormatting = true; programs.nixvim.plugins = {
hover = true; lsp.servers.efm = {
documentSymbol = true; enable = true;
codeAction = true; extraOptions.init_options = {
completion = true; documentFormatting = true;
documentRangeFormatting = true;
hover = true;
documentSymbol = true;
codeAction = true;
completion = true;
};
}; };
};
lsp-format = { lsp-format = {
enable = true; enable = true;
lspServersToEnable = ["efm"]; lspServersToEnable = [ "efm" ];
}; };
efmls-configs.enable = true; efmls-configs.enable = true;
};
}; };
} }

View File

@@ -1,12 +1,24 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.floaterm;
in
{ {
programs.nixvim.plugins.floaterm = { options = {
enable = true; modules.devtools.neovim.plugins.floaterm.enable = mkEnableOption "Enables Floaterm plugin for Neovim";
};
width = 0.8; config = mkIf cfg.enable {
height = 0.8; programs.nixvim.plugins.floaterm = {
enable = true;
width = 0.8;
height = 0.8;
title = "";
title = ""; keymaps.toggle = "<leader>,";
};
keymaps.toggle = "<leader>,";
}; };
} }

View File

@@ -1,6 +1,18 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.harpoon;
in
{ {
programs.nixvim = { options = {
plugins.harpoon = { modules.devtools.neovim.plugins.harpoon.enable = mkEnableOption "Enables Harpoon plugin for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.harpoon = {
enable = true; enable = true;
keymapsSilent = true; keymapsSilent = true;

View File

@@ -1,84 +1,85 @@
{ {
programs.nixvim = { lib,
plugins = { config,
lsp = { ...
enable = true; }: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.lsp;
in {
options = {
modules.devtools.neovim.plugins.lsp = {
enable = mkEnableOption "Enables LSP support for Neovim";
servers = {
cssls.enable = mkEnableOption "Enable CSS LSP";
tailwindcss.enable = mkEnableOption "Enable TailwindCSS LSP";
html.enable = mkEnableOption "Enable HTML LSP";
astro.enable = mkEnableOption "Enable AstroJS LSP";
phpactor.enable = mkEnableOption "Enable PHP LSP";
svelte.enable = mkEnableOption "Enable Svelte LSP";
vuels.enable = mkEnableOption "Enable Vue LSP";
pyright.enable = mkEnableOption "Enable Python LSP";
marksman.enable = mkEnableOption "Enable Markdown LSP";
nixd.enable = mkEnableOption "Enable Nix LSP";
dockerls.enable = mkEnableOption "Enable Docker LSP";
bashls.enable = mkEnableOption "Enable Bash LSP";
clangd.enable = mkEnableOption "Enable C/C++ LSP";
csharp-ls.enable = mkEnableOption "Enable C# LSP";
yamlls.enable = mkEnableOption "Enable YAML LSP";
lua-ls.enable = mkEnableOption "Enable Lua LSP";
tsserver.enable = mkEnableOption "Enable TypeScript/JavaScript LSP";
rust-analyzer.enable = mkEnableOption "Enable Rust LSP";
};
};
};
keymaps = { config = mkIf cfg.enable {
silent = true; programs.nixvim.plugins.lsp = {
diagnostic = { enable = true;
# Navigate in diagnostics
"<leader>k" = "goto_prev";
"<leader>j" = "goto_next";
};
lspBuf = { keymaps = {
gd = "definition"; silent = true;
gD = "references"; diagnostic = {
gt = "type_definition"; "<leader>k" = "goto_prev";
gi = "implementation"; "<leader>j" = "goto_next";
K = "hover";
"<F2>" = "rename";
};
}; };
# Language server lspBuf = {
servers = { gd = "definition";
# Average webdev LSPs gD = "references";
cssls.enable = true; # CSS gt = "type_definition";
tailwindcss.enable = true; # TailwindCSS gi = "implementation";
html.enable = true; # HTML K = "hover";
astro.enable = false; # AstroJS "<F2>" = "rename";
phpactor.enable = true; # PHP };
svelte.enable = false; # Svelte };
vuels.enable = false; # Vue
# Python servers = {
pyright.enable = true; cssls = mkIf cfg.servers.cssls.enable {};
tailwindcss = mkIf cfg.servers.tailwindcss.enable {};
# Markdown html = mkIf cfg.servers.html.enable {};
marksman.enable = true; astro = mkIf cfg.servers.astro.enable {};
phpactor = mkIf cfg.servers.phpactor.enable {};
# Nix svelte = mkIf cfg.servers.svelte.enable {};
nixd.enable = true; vuels = mkIf cfg.servers.vuels.enable {};
pyright = mkIf cfg.servers.pyright.enable {};
# Docker marksman = mkIf cfg.servers.marksman.enable {};
dockerls.enable = true; nixd = mkIf cfg.servers.nixd.enable {};
dockerls = mkIf cfg.servers.dockerls.enable {};
# Bash bashls = mkIf cfg.servers.bashls.enable {};
bashls.enable = true; clangd = mkIf cfg.servers.clangd.enable {};
csharp-ls = mkIf cfg.servers.csharp-ls.enable {};
# C/C++ yamlls = mkIf cfg.servers.yamlls.enable {};
clangd.enable = true; lua-ls = mkIf cfg.servers.lua-ls.enable {
settings.telemetry.enable = false;
# C# settings.diagnostics.globals = ["vim"];
csharp-ls.enable = true; };
tsserver = mkIf cfg.servers.tsserver.enable {};
# Yaml rust-analyzer = mkIf cfg.servers.rust-analyzer.enable {
yamlls.enable = true; installRustc = true;
installCargo = true;
# Lua settings = {
lua-ls = { checkOnSave = true;
enable = true; check.command = "clippy";
settings.telemetry.enable = false;
settings.diagnostics = {
globals = ["vim"];
};
};
tsserver = {
enable = false; # TS/JS
};
# Rust
rust-analyzer = {
enable = true;
installRustc = true;
installCargo = true;
settings = {
checkOnSave = true;
check = {
command = "clippy";
};
};
}; };
}; };
}; };

View File

@@ -1,47 +1,57 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.lualine;
in
{ {
programs.nixvim.plugins.lualine = { options = {
enable = true; modules.devtools.neovim.plugins.lualine.enable = mkEnableOption "Enables Lualine plugin for Neovim";
theme = "gruvbox-material"; };
globalstatus = true; config = mkIf cfg.enable {
programs.nixvim.plugins.lualine = {
enable = true;
theme = "gruvbox-material";
globalstatus = true;
# +-------------------------------------------------+ sections = {
# | A | B | C X | Y | Z | lualine_a = [ "mode" ];
# +-------------------------------------------------+ lualine_b = [ "branch" ];
sections = { lualine_c = [ "filename" "diff" ];
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = [ lualine_x = [
"diagnostics" "diagnostics"
# Show active language server # Show active language server
{ {
name.__raw = '' name.__raw = ''
function() function()
local msg = "" local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_active_clients()
if next(clients) == nil then if next(clients) == nil then
return msg return msg
end end
for _, client in ipairs(clients) do for _, client in ipairs(clients) do
local filetypes = client.config.filetypes local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name return client.name
end end
end end
return msg return msg
end end
''; '';
icon = ""; icon = "";
color.fg = "#ffffff"; color.fg = "#ffffff";
} }
"encoding" "encoding"
"fileformat" "fileformat"
"filetype" "filetype"
]; ];
};
}; };
}; };
} }

View File

@@ -1,20 +1,34 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.markdown-preview;
in
{ {
programs.nixvim = { options = {
plugins.markdown-preview = { modules.devtools.neovim.plugins.markdown-preview.enable = mkEnableOption "Enables Markdown Preview plugin for Neovim";
enable = true; };
settings = { config = mkIf cfg.enable {
auto_close = false; programs.nixvim = {
theme = "dark"; plugins.markdown-preview = {
enable = true;
settings = {
auto_close = false;
theme = "dark";
};
}; };
};
files."after/ftplugin/markdown.lua".keymaps = [ files."after/ftplugin/markdown.lua".keymaps = [
{ {
mode = "n"; mode = "n";
key = "<leader>m"; key = "<leader>m";
action = ":MarkdownPreview<cr>"; action = ":MarkdownPreview<cr>";
} }
]; ];
};
}; };
} }

View File

@@ -1,22 +1,36 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.neo-tree;
in
{ {
programs.nixvim = { options = {
keymaps = [ modules.devtools.neovim.plugins.neo-tree.enable = mkEnableOption "Enables Neo-tree plugin for Neovim";
{ };
mode = "n";
key = "<leader>n";
action = ":Neotree action=focus reveal toggle<CR>";
options.silent = true;
}
];
plugins.neo-tree = { config = mkIf cfg.enable {
enable = true; programs.nixvim = {
plugins.neo-tree = {
enable = true;
closeIfLastWindow = true; closeIfLastWindow = true;
window = { window = {
width = 30; width = 30;
autoExpandWidth = true; autoExpandWidth = true;
};
}; };
keymaps = [
{
mode = "n";
key = "<leader>n";
action = ":Neotree action=focus reveal toggle<CR>";
options.silent = true;
}
];
}; };
}; };
} }

View File

@@ -1,43 +1,57 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.none-ls;
in
{ {
programs.nixvim.plugins.none-ls = { options = {
enable = true; modules.devtools.neovim.plugins.none-ls.enable = mkEnableOption "Enables None-LS plugin for Neovim";
settings = { };
cmd = ["bash -c nvim"];
debug = true; config = mkIf cfg.enable {
}; programs.nixvim.plugins.none-ls = {
sources = { enable = true;
code_actions = { settings = {
statix.enable = true; cmd = [ "bash -c nvim" ];
gitsigns.enable = true; debug = true;
}; };
diagnostics = { sources = {
statix.enable = true; code_actions = {
deadnix.enable = true; statix.enable = true;
pylint.enable = true; gitsigns.enable = true;
checkstyle.enable = true;
};
formatting = {
alejandra.enable = true;
stylua.enable = true;
shfmt.enable = true;
nixpkgs_fmt.enable = true;
google_java_format.enable = false;
prettier = {
enable = true;
disableTsServerFormatter = true;
}; };
black = { diagnostics = {
enable = true; statix.enable = true;
settings = '' deadnix.enable = true;
{ pylint.enable = true;
extra_args = { "--fast" }, checkstyle.enable = true;
} };
''; formatting = {
alejandra.enable = true;
stylua.enable = true;
shfmt.enable = true;
nixpkgs_fmt.enable = true;
google_java_format.enable = false;
prettier = {
enable = true;
disableTsServerFormatter = true;
};
black = {
enable = true;
settings = ''
{
extra_args = { "--fast" };
}
'';
};
};
completion = {
luasnip.enable = true;
spell.enable = true;
}; };
};
completion = {
luasnip.enable = true;
spell.enable = true;
}; };
}; };
}; };

View File

@@ -1,32 +1,37 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.startify;
in
{ {
programs.nixvim.plugins.startify = { options = {
enable = true; modules.devtools.neovim.plugins.startify.enable = mkEnableOption "Enables Startify plugin for Neovim";
};
settings = { config = mkIf cfg.enable {
custom_header = [ programs.nixvim.plugins.startify = {
"" enable = true;
" "
" "
" "
" "
" "
" "
];
# When opening a file or bookmark, change to its directory. settings = {
change_to_dir = false; custom_header = [
""
" "
" "
" "
" "
" "
" "
];
# By default, the fortune header uses ASCII characters, because they work for everyone. change_to_dir = false;
# If you set this option to 1 and your 'encoding' is "utf-8", Unicode box-drawing characters will use_unicode = true;
# be used instead. lists = [{ type = "dir"; }];
use_unicode = true; files_number = 30;
skiplist = [ "flake.lock" ];
lists = [{type = "dir";}]; };
files_number = 30;
skiplist = [
"flake.lock"
];
}; };
}; };
} }

View File

@@ -1,17 +1,31 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.tagbar;
in
{ {
programs.nixvim = { options = {
plugins.tagbar = { modules.devtools.neovim.plugins.tagbar.enable = mkEnableOption "Enables Tagbar plugin for Neovim";
enable = true; };
settings.width = 50;
};
keymaps = [ config = mkIf cfg.enable {
{ programs.nixvim = {
mode = "n"; plugins.tagbar = {
key = "<C-g>"; enable = true;
action = ":TagbarToggle<cr>"; settings.width = 50;
options.silent = true; };
}
]; keymaps = [
{
mode = "n";
key = "<C-g>";
action = ":TagbarToggle<cr>";
options.silent = true;
}
];
};
}; };
} }

View File

@@ -1,17 +1,27 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.telescope;
in
{ {
programs.nixvim = { options = {
plugins.telescope = { modules.devtools.neovim.plugins.telescope.enable = mkEnableOption "Enables Telescope plugin for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.telescope = {
enable = true; enable = true;
keymaps = { keymaps = {
# Find files using Telescope command-line sugar.
"<leader>ff" = "find_files"; "<leader>ff" = "find_files";
"<leader>fg" = "live_grep"; "<leader>fg" = "live_grep";
"<leader>b" = "buffers"; "<leader>b" = "buffers";
"<leader>fh" = "help_tags"; "<leader>fh" = "help_tags";
"<leader>fd" = "diagnostics"; "<leader>fd" = "diagnostics";
# FZF like bindings
"<C-p>" = "git_files"; "<C-p>" = "git_files";
"<leader>p" = "oldfiles"; "<leader>p" = "oldfiles";
"<C-f>" = "live_grep"; "<C-f>" = "live_grep";

View File

@@ -1,26 +1,41 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.treesitter;
in
{ {
programs.nixvim.plugins = { options = {
treesitter = { modules.devtools.neovim.plugins = {
enable = true; treesitter.enable = mkEnableOption "Enables Treesitter plugin for Neovim";
nixvimInjections = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
folding = true;
}; };
};
treesitter-refactor = { config = mkIf cfg.enable {
enable = true; programs.nixvim.plugins = {
highlightDefinitions = { treesitter = {
enable = true;
nixvimInjections = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
folding = true;
};
treesitter-refactor = mkIf cfg.enable {
enable = true;
highlightDefinitions = {
enable = true;
clearOnCursorMove = false;
};
};
hmts = mkIf cfg.enable {
enable = true; enable = true;
# Set to false if you have an `updatetime` of ~100.
clearOnCursorMove = false;
}; };
}; };
hmts.enable = true;
}; };
} }

View File

@@ -1,77 +1,79 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.vimtex;
in
{ {
programs.nixvim = { options = {
plugins.vimtex = { modules.devtools.neovim.plugins.vimtex.enable = mkEnableOption "Enables VimTeX plugin for Neovim";
enable = true; };
settings = { config = mkIf cfg.enable {
view_method = "zathura"; programs.nixvim = {
plugins.vimtex = {
quickfix_enabled = true; enable = true;
quickfix_open_on_warning = false; settings = {
view_method = "zathura";
# Ignore undesired errors and warnings quickfix_enabled = true;
quickfix_ignore_filters = [ quickfix_open_on_warning = false;
"Underfull" quickfix_ignore_filters = [
"Overfull" "Underfull"
"specifier changed to" "Overfull"
"Token not allowed in a PDF string" "specifier changed to"
]; "Token not allowed in a PDF string"
];
# TOC settings toc_config = {
toc_config = { name = "TOC";
name = "TOC"; layers = [ "content" "todo" ];
layers = ["content" "todo"]; resize = true;
resize = true; split_width = 50;
split_width = 50; todo_sorted = false;
todo_sorted = false; show_help = true;
show_help = true; show_numbers = true;
show_numbers = true; mode = 2;
mode = 2; };
}; };
}; };
files."after/ftplugin/tex.lua".keymaps = [
{
mode = "n";
key = "m";
action = ":VimtexView<cr>";
}
];
autoCmd = [
{
event = [ "BufEnter" "BufWinEnter" ];
pattern = "*.tex";
command = "set filetype=tex \"| VimtexTocOpen";
}
{
event = "FileType";
pattern = [ "tex" "latex" ];
callback = ''
function ()
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
vim.o.foldtext = 'vimtex#fold#text()'
end
'';
}
{
event = "User";
pattern = "VimtexEventInitPost";
callback = "vimtex#compiler#compile";
}
{
event = "User";
pattern = "VimtexEventQuit";
command = "call vimtex#compiler#clean(0)";
}
];
}; };
files."after/ftplugin/tex.lua".keymaps = [
{
mode = "n";
key = "m";
action = ":VimtexView<cr>";
}
];
autoCmd = [
{
event = ["BufEnter" "BufWinEnter"];
pattern = "*.tex";
command = "set filetype=tex \"| VimtexTocOpen";
}
# Folding
{
event = "FileType";
pattern = ["tex" "latex"];
callback.__raw = ''
function ()
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
vim.o.foldtext = 'vimtex#fold#text()'
end
'';
}
# Compile on initialization
{
event = "User";
pattern = "VimtexEventInitPost";
callback = "vimtex#compiler#compile";
}
# Cleanup on exit
{
event = "User";
pattern = "VimtexEventQuit";
command = "call vimtex#compiler#clean(0)";
}
];
}; };
} }

View File

@@ -1,5 +1,19 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.yanky;
in
{ {
programs.nixvim.plugins.yanky = { options = {
enable = true; modules.devtools.neovim.plugins.yanky.enable = mkEnableOption "Enables Yanky plugin for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.yanky = {
enable = true;
};
}; };
} }

View File

@@ -1,11 +1,12 @@
{ { lib
lib, , config
config, , ...
... }:
}: let let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.modules.wm.hyprland.toothpick.inputs; cfg = config.modules.wm.hyprland.toothpick.inputs;
in { in
{
options = { options = {
modules.wm.hyprland.toothpick.inputs.enable = mkEnableOption "Enables input settings in Hyprland"; modules.wm.hyprland.toothpick.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
}; };
@@ -48,7 +49,7 @@ in {
workspace_swipe_create_new = true; workspace_swipe_create_new = true;
}; };
misc = { misc = {
vrr = 2; vrr = 0;
mouse_move_enables_dpms = 1; mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0; key_press_enables_dpms = 0;
force_default_wallpaper = 0; force_default_wallpaper = 0;
@@ -59,8 +60,8 @@ in {
force_zero_scaling = false; force_zero_scaling = false;
}; };
render = { render = {
explicit_sync = 2; explicit_sync = 0;
explicit_sync_kms = 2; explicit_sync_kms = 0;
direct_scanout = false; direct_scanout = false;
}; };
cursor = { cursor = {

View File

@@ -18,7 +18,7 @@
sessionVariables = { sessionVariables = {
BROWSER = "firefox"; BROWSER = "firefox";
EDITOR = "nvim"; EDITOR = "nvim";
TERM = "foot"; TERM = "xterm-256color";
QT_QPA_PLATFORM = "wayland"; QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland"; SDL_VIDEODRIVER = "wayland";

View File

@@ -8,7 +8,51 @@
discord.enable = true; discord.enable = true;
}; };
devtools = { devtools = {
neovim.enable = true; neovim = {
enable = true;
plugins = {
ai.enable = true;
barbar.enable = true;
comment.enable = true;
conform-nvim.enable = true;
efm.enable = true;
lualine.enable = true;
markdown-preview.enable = true;
neo-tree.enable = true;
none-ls.enable = true;
startify.enable = true;
telescope.enable = true;
treesitter.enable = true;
floaterm.enable = false;
harpoon.enable = false;
tagbar.enable = false;
vimtex.enable = false;
yanky.enable = false;
lsp = {
enable = true;
servers = {
cssls.enable = true;
tailwindcss.enable = true;
html.enable = true;
astro.enable = false;
phpactor.enable = true;
svelte.enable = false;
vuels.enable = false;
pyright.enable = true;
marksman.enable = true;
nixd.enable = true;
dockerls.enable = true;
bashls.enable = true;
clangd.enable = true;
csharp-ls.enable = true;
yamlls.enable = true;
lua-ls.enable = true;
tsserver.enable = false;
rust-analyzer.enable = true;
};
};
};
};
vscode.enable = false; vscode.enable = false;
}; };
gaming = { gaming = {

View File

@@ -16,7 +16,7 @@
sessionVariables = { sessionVariables = {
BROWSER = "firefox"; BROWSER = "firefox";
EDITOR = "nvim"; EDITOR = "nvim";
TERM = "kitty"; TERM = "xterm-256color";
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/cnst/.steam/root/compatibilitytools.d"; # proton and steam compat STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/cnst/.steam/root/compatibilitytools.d"; # proton and steam compat
QT_QPA_PLATFORM = "wayland"; QT_QPA_PLATFORM = "wayland";

View File

@@ -8,7 +8,51 @@
discord.enable = true; discord.enable = true;
}; };
devtools = { devtools = {
neovim.enable = true; neovim = {
enable = true;
plugins = {
ai.enable = true;
barbar.enable = true;
comment.enable = true;
conform-nvim.enable = true;
efm.enable = true;
lualine.enable = true;
markdown-preview.enable = true;
neo-tree.enable = true;
none-ls.enable = true;
startify.enable = true;
telescope.enable = true;
treesitter.enable = true;
floaterm.enable = false;
harpoon.enable = false;
tagbar.enable = false;
vimtex.enable = false;
yanky.enable = false;
lsp = {
enable = true;
servers = {
cssls.enable = true;
tailwindcss.enable = true;
html.enable = true;
astro.enable = false;
phpactor.enable = true;
svelte.enable = false;
vuels.enable = false;
pyright.enable = true;
marksman.enable = true;
nixd.enable = true;
dockerls.enable = true;
bashls.enable = true;
clangd.enable = true;
csharp-ls.enable = true;
yamlls.enable = true;
lua-ls.enable = true;
tsserver.enable = false;
rust-analyzer.enable = true;
};
};
};
};
vscode.enable = false; vscode.enable = false;
}; };
gaming = { gaming = {

View File

@@ -17,7 +17,7 @@
sessionVariables = { sessionVariables = {
BROWSER = "firefox"; BROWSER = "firefox";
EDITOR = "nvim"; EDITOR = "nvim";
TERM = "foot"; TERM = "xterm-256color";
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/toothpick/.steam/root/compatibilitytools.d"; # proton and steam compat STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/toothpick/.steam/root/compatibilitytools.d"; # proton and steam compat
LIBVA_DRIVER_NAME = "nvidia"; LIBVA_DRIVER_NAME = "nvidia";

View File

@@ -8,7 +8,51 @@
discord.enable = true; discord.enable = true;
}; };
devtools = { devtools = {
neovim.enable = true; neovim = {
enable = true;
plugins = {
ai.enable = false;
barbar.enable = true;
comment.enable = true;
conform-nvim.enable = true;
efm.enable = true;
lualine.enable = true;
markdown-preview.enable = true;
neo-tree.enable = true;
none-ls.enable = true;
startify.enable = true;
telescope.enable = true;
treesitter.enable = true;
floaterm.enable = false;
harpoon.enable = false;
tagbar.enable = false;
vimtex.enable = false;
yanky.enable = false;
lsp = {
enable = true;
servers = {
cssls.enable = true;
tailwindcss.enable = true;
html.enable = true;
astro.enable = false;
phpactor.enable = true;
svelte.enable = false;
vuels.enable = false;
pyright.enable = true;
marksman.enable = true;
nixd.enable = true;
dockerls.enable = true;
bashls.enable = true;
clangd.enable = true;
csharp-ls.enable = true;
yamlls.enable = true;
lua-ls.enable = true;
tsserver.enable = false;
rust-analyzer.enable = true;
};
};
};
};
vscode.enable = true; vscode.enable = true;
}; };
gaming = { gaming = {

View File

@@ -64,6 +64,8 @@
corectrl.enable = true; corectrl.enable = true;
microfetch.enable = true; microfetch.enable = true;
nix-ld.enable = false; nix-ld.enable = false;
misc.enable = true;
npm.enable = true;
}; };
}; };
} }

View File

@@ -36,5 +36,7 @@
"${systemModules}/utils/corectrl" "${systemModules}/utils/corectrl"
"${systemModules}/utils/microfetch" "${systemModules}/utils/microfetch"
"${systemModules}/utils/nix-ld" "${systemModules}/utils/nix-ld"
"${systemModules}/utils/misc"
"${systemModules}/utils/npm"
]; ];
} }

View File

@@ -0,0 +1,20 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.utils.misc;
in {
options = {
modules.utils.misc.enable = mkEnableOption "Enables miscellaneous pacakges";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
nodejs_22
ripgrep
fd
];
};
}

View File

@@ -0,0 +1,17 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.utils.npm;
in {
options = {
modules.utils.npm.enable = mkEnableOption "Enables npm";
};
config = mkIf cfg.enable {
programs.npm = {
enable = true;
};
};
}