761
flake.lock
generated
761
flake.lock
generated
File diff suppressed because it is too large
Load Diff
33
flake.nix
33
flake.nix
@@ -45,10 +45,6 @@
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
@@ -56,6 +52,9 @@
|
||||
# cachyos
|
||||
chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz";
|
||||
|
||||
#hmm
|
||||
helix.url = "github:SoraTenshi/helix/new-daily-driver";
|
||||
|
||||
# hyprland environ
|
||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
||||
hyprland-contrib = {
|
||||
@@ -71,6 +70,24 @@
|
||||
systems.follows = "hyprland/systems";
|
||||
};
|
||||
};
|
||||
hypridle = {
|
||||
url = "github:hyprwm/hypridle";
|
||||
inputs = {
|
||||
hyprlang.follows = "hyprland/hyprlang";
|
||||
hyprutils.follows = "hyprland/hyprutils";
|
||||
nixpkgs.follows = "hyprland/nixpkgs";
|
||||
systems.follows = "hyprland/systems";
|
||||
};
|
||||
};
|
||||
hyprpaper = {
|
||||
url = "github:hyprwm/hyprpaper";
|
||||
inputs = {
|
||||
hyprlang.follows = "hyprland/hyprlang";
|
||||
hyprutils.follows = "hyprland/hyprutils";
|
||||
nixpkgs.follows = "hyprland/nixpkgs";
|
||||
systems.follows = "hyprland/systems";
|
||||
};
|
||||
};
|
||||
nix-gaming = {
|
||||
url = "github:fufexan/nix-gaming";
|
||||
inputs = {
|
||||
@@ -99,5 +116,13 @@
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
wezterm = {
|
||||
url = "github:wez/wezterm/main?dir=nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# naersk = {
|
||||
# url = "github:nix-community/naersk";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,5 +40,11 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
"text/html" = ["firefox.desktop"];
|
||||
"text/xml" = ["firefox.desktop"];
|
||||
"x-scheme-handler/http" = ["firefox.desktop"];
|
||||
"x-scheme-handler/https" = ["firefox.desktop"];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
"${userModules}/browsers/chromium"
|
||||
"${userModules}/browsers/firefox"
|
||||
"${userModules}/comm/discord"
|
||||
#"${userModules}/devtools/neovim"
|
||||
"${userModules}/devtools/nixvim"
|
||||
"${userModules}/devtools/neovim"
|
||||
"${userModules}/devtools/vscode"
|
||||
"${userModules}/devtools/helix"
|
||||
"${userModules}/gaming/lutris"
|
||||
"${userModules}/gaming/mangohud"
|
||||
"${userModules}/terminal/alacritty"
|
||||
"${userModules}/terminal/foot"
|
||||
"${userModules}/terminal/kitty"
|
||||
"${userModules}/terminal/wezterm"
|
||||
"${userModules}/terminal/zellij"
|
||||
"${userModules}/userd/copyq"
|
||||
"${userModules}/userd/mako"
|
||||
@@ -21,6 +22,7 @@
|
||||
"${userModules}/utils/rofi"
|
||||
"${userModules}/utils/waybar"
|
||||
"${userModules}/utils/yazi"
|
||||
"${userModules}/utils/zathura"
|
||||
"${userModules}/wm/hyprland"
|
||||
"${userModules}/wm/utils/hypridle"
|
||||
"${userModules}/wm/utils/hyprlock"
|
||||
|
||||
63
home/modules/devtools/helix/default.nix
Normal file
63
home/modules/devtools/helix/default.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.devtools.helix;
|
||||
in {
|
||||
imports = [./languages.nix];
|
||||
|
||||
options = {
|
||||
modules.devtools.helix.enable = mkEnableOption "Enable helix";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
package = inputs.helix.packages.${pkgs.system}.default;
|
||||
|
||||
settings = {
|
||||
theme = "gruvbox_material_dark_soft";
|
||||
editor = {
|
||||
color-modes = true;
|
||||
cursorline = true;
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
indent-guides.render = true;
|
||||
inline-diagnostics = {
|
||||
cursor-line = "hint";
|
||||
other-lines = "error";
|
||||
};
|
||||
lsp.display-inlay-hints = true;
|
||||
statusline.center = ["position-percentage"];
|
||||
true-color = true;
|
||||
whitespace.characters = {
|
||||
newline = "↴";
|
||||
tab = "⇥";
|
||||
};
|
||||
};
|
||||
|
||||
keys = {
|
||||
normal = {
|
||||
y = "yank_to_clipboard";
|
||||
p = "paste_clipboard_after";
|
||||
space.u = {
|
||||
f = ":format"; # format using LSP formatter
|
||||
w = ":set whitespace.render all";
|
||||
W = ":set whitespace.render none";
|
||||
};
|
||||
};
|
||||
insert = {
|
||||
C-v = "paste_clipboard_after";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
188
home/modules/devtools/helix/languages.nix
Normal file
188
home/modules/devtools/helix/languages.nix
Normal file
@@ -0,0 +1,188 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.helix.languages = {
|
||||
language = let
|
||||
deno = lang: {
|
||||
command = lib.getExe pkgs.deno;
|
||||
args = ["fmt" "-" "--ext" lang];
|
||||
};
|
||||
|
||||
prettier = lang: {
|
||||
command = lib.getExe pkgs.nodePackages.prettier;
|
||||
args = ["--parser" lang];
|
||||
};
|
||||
prettierLangs = map (e: {
|
||||
name = e;
|
||||
formatter = prettier e;
|
||||
});
|
||||
langs = ["css" "scss" "html"];
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "bash";
|
||||
auto-format = true;
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.shfmt;
|
||||
args = ["-i" "2"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "clojure";
|
||||
injection-regex = "(clojure|clj|edn|boot|yuck)";
|
||||
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
|
||||
}
|
||||
{
|
||||
name = "cmake";
|
||||
auto-format = true;
|
||||
language-servers = ["cmake-language-server"];
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.cmake-format;
|
||||
args = ["-"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "lua";
|
||||
auto-format = true;
|
||||
language-servers = ["lua-language-server"];
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.stylua;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "javascript";
|
||||
auto-format = true;
|
||||
language-servers = ["dprint" "typescript-language-server"];
|
||||
}
|
||||
{
|
||||
name = "json";
|
||||
formatter = deno "json";
|
||||
}
|
||||
{
|
||||
name = "markdown";
|
||||
auto-format = true;
|
||||
formatter = deno "md";
|
||||
}
|
||||
{
|
||||
name = "python";
|
||||
language-servers = ["pyright"];
|
||||
formatter = {
|
||||
command = lib.getExe pkgs.black;
|
||||
args = ["-" "--quiet" "--line-length 100"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "typescript";
|
||||
auto-format = true;
|
||||
language-servers = ["dprint" "typescript-language-server"];
|
||||
}
|
||||
]
|
||||
++ prettierLangs langs;
|
||||
|
||||
language-server = {
|
||||
bash-language-server = {
|
||||
command = lib.getExe pkgs.bash-language-server;
|
||||
args = ["start"];
|
||||
};
|
||||
|
||||
clangd = {
|
||||
command = "${pkgs.clang-tools}/bin/clangd";
|
||||
clangd.fallbackFlags = ["-std=c++2b"];
|
||||
};
|
||||
|
||||
cmake-language-server = {
|
||||
command = lib.getExe pkgs.cmake-language-server;
|
||||
};
|
||||
|
||||
lua-language-server = {
|
||||
command = lib.getExe pkgs.lua-language-server;
|
||||
};
|
||||
|
||||
deno-lsp = {
|
||||
command = lib.getExe pkgs.deno;
|
||||
args = ["lsp"];
|
||||
environment.NO_COLOR = "1";
|
||||
config.deno = {
|
||||
enable = true;
|
||||
lint = true;
|
||||
unstable = true;
|
||||
suggest = {
|
||||
completeFunctionCalls = false;
|
||||
imports = {hosts."https://deno.land" = true;};
|
||||
};
|
||||
inlayHints = {
|
||||
enumMemberValues.enabled = true;
|
||||
functionLikeReturnTypes.enabled = true;
|
||||
parameterNames.enabled = "all";
|
||||
parameterTypes.enabled = true;
|
||||
propertyDeclarationTypes.enabled = true;
|
||||
variableTypes.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dprint = {
|
||||
command = lib.getExe pkgs.dprint;
|
||||
args = ["lsp"];
|
||||
};
|
||||
|
||||
nil = {
|
||||
command = lib.getExe pkgs.nil;
|
||||
config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"];
|
||||
};
|
||||
|
||||
pyright = {
|
||||
command = "${pkgs.pyright}/bin/pyright-langserver";
|
||||
args = ["--stdio"];
|
||||
config = {
|
||||
reportMissingTypeStubs = false;
|
||||
analysis = {
|
||||
typeCheckingMode = "basic";
|
||||
autoImportCompletions = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
typescript-language-server = {
|
||||
command = lib.getExe pkgs.nodePackages.typescript-language-server;
|
||||
args = ["--stdio"];
|
||||
config = let
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
};
|
||||
in {
|
||||
typescript-language-server.source = {
|
||||
addMissingImports.ts = true;
|
||||
fixAll.ts = true;
|
||||
organizeImports.ts = true;
|
||||
removeUnusedImports.ts = true;
|
||||
sortImports.ts = true;
|
||||
};
|
||||
|
||||
typescript = {inherit inlayHints;};
|
||||
javascript = {inherit inlayHints;};
|
||||
|
||||
hostInfo = "helix";
|
||||
};
|
||||
};
|
||||
|
||||
vscode-css-language-server = {
|
||||
command = "${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-css-languageserver";
|
||||
args = ["--stdio"];
|
||||
config = {
|
||||
provideFormatter = true;
|
||||
css.validate.enable = true;
|
||||
scss.validate.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
-- Faster completion
|
||||
vim.opt.updatetime = 100
|
||||
|
||||
-- Line numbers
|
||||
vim.opt.relativenumber = false -- Relative line numbers
|
||||
vim.opt.number = true -- Display the absolute line number of the current line
|
||||
|
||||
-- Buffer and window options
|
||||
vim.opt.hidden = true -- Keep closed buffer open in the background
|
||||
vim.opt.showmode = false -- Do not show the mode in the command line
|
||||
vim.opt.mouse = "a" -- Enable mouse control
|
||||
vim.opt.mousemodel = "popup" -- Mouse right-click extends the current selection
|
||||
vim.opt.splitbelow = true -- A new window is put below the current one
|
||||
vim.opt.splitright = true -- A new window is put right of the current one
|
||||
|
||||
-- List options
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = {
|
||||
tab = "▷ ",
|
||||
trail = "·",
|
||||
nbsp = "○",
|
||||
extends = "◣",
|
||||
precedes = "◢",
|
||||
}
|
||||
|
||||
-- Swap and undo files
|
||||
vim.opt.swapfile = false -- Disable the swap file
|
||||
vim.opt.modeline = true -- Tags such as 'vim:ft=sh'
|
||||
vim.opt.modelines = 100 -- Sets the type of modelines
|
||||
vim.opt.undofile = true -- Automatically save and restore undo history
|
||||
|
||||
-- Search options
|
||||
vim.opt.incsearch = true -- Incremental search: show match for partly typed search command
|
||||
vim.opt.inccommand = "split" -- Search and replace: preview changes in quickfix list
|
||||
vim.opt.ignorecase = true -- When the search query is lower-case, match both lower and upper-case patterns
|
||||
vim.opt.smartcase = true -- Override the 'ignorecase' option if the search pattern contains upper case characters
|
||||
|
||||
-- Scrolling and cursor options
|
||||
vim.opt.scrolloff = 4 -- Number of screen lines to show around the cursor
|
||||
vim.opt.cursorline = true -- Highlight the screen line of the cursor
|
||||
vim.opt.cursorcolumn = false -- Highlight the screen column of the cursor
|
||||
vim.opt.signcolumn = "yes" -- Whether to show the signcolumn
|
||||
|
||||
-- Display options
|
||||
vim.opt.colorcolumn = "" -- Columns to highlight
|
||||
vim.opt.laststatus = 3 -- When to use a status line for the last window
|
||||
vim.opt.fileencoding = "utf-8" -- File-content encoding for the current buffer
|
||||
vim.opt.spell = false -- Highlight spelling mistakes (local to window)
|
||||
vim.opt.wrap = false -- Prevent text from wrapping
|
||||
|
||||
-- Tab options
|
||||
vim.opt.tabstop = 4 -- Number of spaces a <Tab> in the text stands for (local to buffer)
|
||||
vim.opt.shiftwidth = 4 -- Number of spaces used for each step of (auto)indent (local to buffer)
|
||||
vim.opt.expandtab = true -- Expand <Tab> to spaces in Insert mode (local to buffer)
|
||||
vim.opt.autoindent = true -- Do clever autoindenting
|
||||
|
||||
-- Text width
|
||||
vim.opt.textwidth = 0 -- Maximum width of text that is being inserted
|
||||
|
||||
-- Folding
|
||||
vim.opt.foldlevel = 99 -- Folds with a level higher than this number will be closed
|
||||
@@ -1,39 +0,0 @@
|
||||
local lspc = require'lspconfig'
|
||||
|
||||
-- Setup for LSP servers
|
||||
lspc.tsserver.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
client.resolved_capabilities.document_range_formatting = false
|
||||
|
||||
local ts_utils = require("nvim-lsp-ts-utils")
|
||||
ts_utils.setup({})
|
||||
ts_utils.setup_client(client)
|
||||
|
||||
local buf_map = function(bufnr, mode, lhs, rhs, opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { silent = true })
|
||||
end
|
||||
|
||||
buf_map(bufnr, "n", "gs", ":TSLspOrganize<CR>")
|
||||
buf_map(bufnr, "n", "gi", ":TSLspRenameFile<CR>")
|
||||
buf_map(bufnr, "n", "go", ":TSLspImportAll<CR>")
|
||||
|
||||
-- Custom on_attach functionality
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
})
|
||||
lspc.cssls.setup{}
|
||||
lspc.clangd.setup{}
|
||||
lspc.tailwindcss.setup{}
|
||||
lspc.html.setup{}
|
||||
lspc.astro.setup{}
|
||||
lspc.phpactor.setup{}
|
||||
lspc.pyright.setup{}
|
||||
lspc.marksman.setup{}
|
||||
lspc.nixd.setup{}
|
||||
lspc.dockerls.setup{}
|
||||
lspc.bashls.setup{}
|
||||
lspc.csharp_ls.setup{}
|
||||
lspc.yamlls.setup{}
|
||||
lspc.lua_ls.setup({
|
||||
})
|
||||
@@ -1,73 +0,0 @@
|
||||
local has_words_before = function()
|
||||
local line, col = table.unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
||||
end
|
||||
|
||||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "cmp_tabnine" },
|
||||
{ name = "treesitter" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "vsnip" },
|
||||
-- { name = "copilot" },
|
||||
},
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
with_text = true,
|
||||
menu = {
|
||||
buffer = "[Buf]",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
latex_symbols = "[Latex]",
|
||||
treesitter = "[TS]",
|
||||
cmp_tabnine = "[TN]",
|
||||
vsnip = "[Snip]",
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
mapping = {
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
},
|
||||
})
|
||||
@@ -1,20 +0,0 @@
|
||||
-- Set colorscheme
|
||||
vim.cmd("set termguicolors")
|
||||
|
||||
-- Configure gruvbox-material
|
||||
vim.g.gruvbox_material_background = "medium" -- Options: 'hard', 'medium', 'soft'
|
||||
vim.g.gruvbox_material_palette = "material" -- Options: 'material', 'original', 'palenight'
|
||||
|
||||
-- Load the gruvbox-material colorscheme
|
||||
vim.cmd([[colorscheme gruvbox-material]])
|
||||
|
||||
-- Enable colorizer
|
||||
require("colorizer").setup()
|
||||
-- set sign
|
||||
vim.cmd("sign define DiagnosticSignError text= linehl= texthl=DiagnosticSignError numhl=")
|
||||
vim.cmd("sign define DiagnosticSignHint text= linehl= texthl=DiagnosticSignHint numhl=")
|
||||
vim.cmd("sign define DiagnosticSignInfo text= linehl= texthl=DiagnosticSignInfo numhl=")
|
||||
vim.cmd("sign define DiagnosticSignWarn text= linehl= texthl=DiagnosticSignWarn numhl=")
|
||||
|
||||
-- set lightline theme to horizon
|
||||
vim.g.lightline = { colorscheme = "apprentice" }
|
||||
@@ -1,14 +0,0 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,39 +0,0 @@
|
||||
-- telescope
|
||||
require("telescope").load_extension("fzy_native")
|
||||
|
||||
-- null-ls
|
||||
local nb = require("null-ls").builtins
|
||||
|
||||
require("null-ls").setup({
|
||||
sources = {
|
||||
nb.formatting.alejandra,
|
||||
nb.code_actions.statix,
|
||||
nb.diagnostics.cppcheck,
|
||||
nb.diagnostics.deadnix,
|
||||
nb.diagnostics.statix,
|
||||
nb.diagnostics.eslint,
|
||||
nb.completion.spell,
|
||||
},
|
||||
})
|
||||
|
||||
require("gitsigns").setup()
|
||||
|
||||
-- autopairs
|
||||
require("nvim-autopairs").setup({})
|
||||
|
||||
-- copy to system clipboard
|
||||
vim.api.nvim_set_keymap("v", "<Leader>y", '"+y', { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<Leader>y", ":%+y<CR>", { noremap = true })
|
||||
|
||||
-- paste from system clipboard
|
||||
vim.api.nvim_set_keymap("n", "<Leader>p", '"+p', { noremap = true })
|
||||
|
||||
-- textyankpost autocmd
|
||||
vim.api.nvim_create_augroup("highlight_yank", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = "highlight_yank",
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
@@ -1,52 +0,0 @@
|
||||
-- Updated Which-Key Spec
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup {}
|
||||
|
||||
wk.register({
|
||||
["<leader>"] = {
|
||||
["/"] = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
|
||||
P = { '"+P', "Paste from clipboard before cursor" },
|
||||
a = { "<cmd>lua require('telescope.builtin').lsp_code_actions()<cr>", "Code Actions" },
|
||||
ac = { "<cmd>CopilotChatToggle<CR>", "Toggle Copilot chat" },
|
||||
b = { "<cmd>Telescope buffers<cr>", "Buffers" },
|
||||
d = { "<cmd>lua require('telescope.builtin').lsp_document_diagnostics()<cr>", "LSP Diagnostics" },
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find File" },
|
||||
g = {
|
||||
b = { "<cmd>ToggleBlameLine<cr>", "Toggle BlameLine" },
|
||||
c = { "<cmd>Neogit commit<cr>", "Commit" },
|
||||
i = { "<cmd>lua require('telescope').extensions.gh.issues()<cr>", "Github Issues" },
|
||||
name = "Git / VCS",
|
||||
p = { "<cmd>lua require('telescope').extensions.gh.pull_request()<cr>", "Github PRs" },
|
||||
s = { "<cmd>Neogit kind=split<cr>", "Staging" }
|
||||
},
|
||||
k = { "<cmd>lua vim.lsp.buf.signature_help()<cr>", "Signature Help" },
|
||||
l = {
|
||||
e = { "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", "Show Line Diagnostics" },
|
||||
f = { "<cmd>lua vim.lsp.buf.formatting_sync()<cr>", "Format file" },
|
||||
name = "LSP",
|
||||
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Set Loclist" }
|
||||
},
|
||||
p = { '"+p', "Paste from clipboard" },
|
||||
qc = { "<cmd>lua local input = vim.fn.input('Quick Chat: '); if input ~= '' then require('CopilotChat').ask(input, { selection = require('CopilotChat.select').buffer }) end<CR>", "CopilotChat - Quick chat" },
|
||||
y = { '"+y', "Yank to clipboard" }
|
||||
},
|
||||
g = {
|
||||
e = { "G", "Bottom" },
|
||||
h = { "0", "Line start" },
|
||||
l = { "$", "Line end" },
|
||||
s = { "^", "First non-blank in line" }
|
||||
},
|
||||
i = {
|
||||
["<C-v>"] = { "<esc>p", "Paste in Insert Mode" }
|
||||
},
|
||||
v = {
|
||||
["<"] = { "<gv", "Indent Left" },
|
||||
["<C-c>"] = { "y", "Yank Selection" },
|
||||
["<S-TAB>"] = { "<gv", "Indent Left" },
|
||||
["<TAB>"] = { ">gv", "Indent Right" },
|
||||
[">"] = { ">gv", "Indent Right" },
|
||||
J = { ":m '>+1<CR>gv=gv", "Move Down" },
|
||||
K = { ":m '<-2<CR>gv=gv", "Move Up" }
|
||||
}
|
||||
}, { prefix = "" })
|
||||
@@ -1,81 +1,155 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.devtools.neovim;
|
||||
in {
|
||||
imports = [
|
||||
./plugins
|
||||
./lsp.nix
|
||||
./syntaxes.nix
|
||||
./keybindings.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
modules.devtools.neovim.enable = mkEnableOption "Enables neovim";
|
||||
modules.devtools.neovim.enable = mkEnableOption "Enable neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
extraLuaConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Use system clipboard
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
vimdiffAlias = true;
|
||||
-- Colorscheme
|
||||
vim.cmd("colorscheme gruvbox-material")
|
||||
|
||||
-- Line Numbers and Cursorline
|
||||
vim.opt.number = true
|
||||
vim.opt.cursorline = true
|
||||
vim.wo.relativenumber = false
|
||||
|
||||
-- Nerd Font
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- Enable persistent undo
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undodir = vim.fn.expand("~/.config/nvim/undo")
|
||||
|
||||
-- Set wildcharm to tab for triggering completion
|
||||
vim.opt.wildcharm = vim.fn.char2nr(vim.api.nvim_replace_termcodes("<Tab>", true, true, true))
|
||||
|
||||
-- Folding
|
||||
vim.opt.foldmethod = "manual"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
-- vim.opt.foldexpr = "v:lua.vim.treesitter.foldtext()"
|
||||
|
||||
-- Tabs
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.softtabstop = 0
|
||||
vim.opt.shiftwidth = 0
|
||||
|
||||
-- 2 char-wide overrides for specific file types
|
||||
vim.api.nvim_create_augroup("two_space_tab", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "json", "html", "htmldjango", "hamlet", "nix", "scss", "typescript", "php", "haskell", "terraform" },
|
||||
command = "setlocal tabstop=2",
|
||||
group = "two_space_tab",
|
||||
})
|
||||
|
||||
-- Set tera to use htmldjango syntax
|
||||
vim.api.nvim_create_augroup("tera_htmldjango", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||
pattern = "*.tera",
|
||||
command = "setfiletype htmldjango",
|
||||
group = "tera_htmldjango",
|
||||
})
|
||||
|
||||
-- Options when composing mutt mail
|
||||
vim.api.nvim_create_augroup("mail_settings", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "mail",
|
||||
command = "set noautoindent wrapmargin=0 textwidth=0 linebreak wrap formatoptions+=w",
|
||||
group = "mail_settings",
|
||||
})
|
||||
|
||||
-- Fix nvim size according to terminal
|
||||
vim.api.nvim_create_augroup("fix_size", { clear = true })
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
pattern = "*",
|
||||
command = "silent exec '!kill -s SIGWINCH' getpid()",
|
||||
group = "fix_size",
|
||||
})
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Diagnostic signs
|
||||
function add_sign(name, text)
|
||||
vim.fn.sign_define(name, { text = text, texthl = name, numhl = name })
|
||||
end
|
||||
|
||||
add_sign("DiagnosticSignError", " ")
|
||||
add_sign("DiagnosticSignWarn", " ")
|
||||
add_sign("DiagnosticSignHint", " ")
|
||||
add_sign("DiagnosticSignInfo", " ")
|
||||
|
||||
'';
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-table-mode
|
||||
editorconfig-nvim
|
||||
vim-surround
|
||||
gruvbox-material-nvim
|
||||
nvim-web-devicons
|
||||
comment-nvim
|
||||
cmp-buffer
|
||||
cmp-nvim-lsp
|
||||
cmp-path
|
||||
cmp-spell
|
||||
cmp-treesitter
|
||||
cmp-vsnip
|
||||
friendly-snippets
|
||||
gitsigns-nvim
|
||||
lightline-vim
|
||||
lspkind-nvim
|
||||
neogit
|
||||
null-ls-nvim
|
||||
nvim-autopairs
|
||||
nvim-cmp
|
||||
nvim-colorizer-lua
|
||||
nvim-lspconfig
|
||||
nvim-tree-lua
|
||||
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars))
|
||||
plenary-nvim
|
||||
rainbow-delimiters-nvim
|
||||
telescope-fzy-native-nvim
|
||||
telescope-nvim
|
||||
vim-floaterm
|
||||
vim-sneak
|
||||
vim-vsnip
|
||||
which-key-nvim
|
||||
copilot-lua
|
||||
copilot-cmp
|
||||
statix
|
||||
phpactor
|
||||
];
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [nixd gcc ripgrep fd deadnix lua-language-server yaml-language-server bash-language-server];
|
||||
|
||||
extraConfig = let
|
||||
luaRequire = module:
|
||||
builtins.readFile (builtins.toString
|
||||
./config
|
||||
+ "/${module}.lua");
|
||||
luaConfig = builtins.concatStringsSep "\n" (map luaRequire [
|
||||
"init"
|
||||
"lspconfig"
|
||||
"nvim-cmp"
|
||||
"theming"
|
||||
"treesitter"
|
||||
"treesitter-textobjects"
|
||||
"utils"
|
||||
"which-key"
|
||||
]);
|
||||
in ''
|
||||
lua <<
|
||||
${luaConfig}
|
||||
|
||||
'';
|
||||
xdg.desktopEntries = {
|
||||
nvim = {
|
||||
name = "Neovim";
|
||||
genericName = "Text Editor";
|
||||
comment = "Edit text files";
|
||||
exec = "nvim %F";
|
||||
icon = "nvim";
|
||||
mimeType = [
|
||||
"text/english"
|
||||
"text/plain"
|
||||
"text/x-makefile"
|
||||
"text/x-c++hdr"
|
||||
"text/x-c++src"
|
||||
"text/x-chdr"
|
||||
"text/x-csrc"
|
||||
"text/x-java"
|
||||
"text/x-moc"
|
||||
"text/x-pascal"
|
||||
"text/x-tcl"
|
||||
"text/x-tex"
|
||||
"application/x-shellscript"
|
||||
"text/x-c"
|
||||
"text/x-c++"
|
||||
];
|
||||
terminal = true;
|
||||
type = "Application";
|
||||
categories = [
|
||||
"Utility"
|
||||
"TextEditor"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
79
home/modules/devtools/neovim/keybindings.nix
Normal file
79
home/modules/devtools/neovim/keybindings.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
config = {
|
||||
programs.neovim = {
|
||||
extraLuaConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Key mappings for various commands and navigation
|
||||
vim.api.nvim_set_keymap("n", "<C-j>", "<C-e>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-k>", "<C-y>", { noremap = true })
|
||||
|
||||
-- Buffers
|
||||
vim.api.nvim_set_keymap("n", "<space>b", ":buffers<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-l>", ":bnext<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-h>", ":bprev<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-q>", ":bdel<CR>", { noremap = true })
|
||||
|
||||
-- Navigation
|
||||
vim.api.nvim_set_keymap("n", "<space>e", ":e<space>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>E", ":e %:h<tab>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>c", ":cd<space>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>C", ":cd %:h<tab>", { noremap = true })
|
||||
|
||||
-- Loclist
|
||||
vim.api.nvim_set_keymap("n", "<space>l", ":lwindow<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[l", ":lprev<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]l", ":lnext<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>L", ":lhistory<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[L", ":lolder<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]L", ":lnewer<cr>", { noremap = true })
|
||||
|
||||
-- Quickfix
|
||||
vim.api.nvim_set_keymap("n", "<space>q", ":cwindow<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[q", ":cprev<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]q", ":cnext<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>Q", ":chistory<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "[Q", ":colder<cr>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "]Q", ":cnewer<cr>", { noremap = true })
|
||||
|
||||
-- Make
|
||||
vim.api.nvim_set_keymap("n", "<space>m", ":make<cr>", { noremap = true })
|
||||
|
||||
-- Grep (replace with ripgrep)
|
||||
vim.api.nvim_set_keymap("n", "<space>g", ":grep<space>", { noremap = true })
|
||||
if vim.fn.executable("rg") == 1 then
|
||||
vim.opt.grepprg = "rg --vimgrep"
|
||||
vim.opt.grepformat = "%f:%l:%c:%m"
|
||||
end
|
||||
|
||||
-- Close other splits
|
||||
vim.api.nvim_set_keymap("n", "<space>o", ":only<cr>", { noremap = true })
|
||||
|
||||
-- Sudo save
|
||||
vim.api.nvim_set_keymap("c", "w!!", "w !sudo tee > /dev/null %", { noremap = true })
|
||||
|
||||
-- Other utility key mappings
|
||||
vim.keymap.set("n", "<C-a>", "ggVG", { desc = "Select all" })
|
||||
vim.keymap.set("n", "<C-v>", "p", { desc = "Paste" })
|
||||
vim.keymap.set("i", "<C-v>", "<esc>p", { desc = "Paste" })
|
||||
vim.keymap.set("v", "<C-c>", "y", { desc = "Yank" })
|
||||
|
||||
-- LSP-related mappings
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" })
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" })
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Hover Documentation" })
|
||||
vim.keymap.set("n", "<space>a", vim.lsp.buf.code_action, { desc = "Code action" })
|
||||
|
||||
-- Diagnostics
|
||||
vim.keymap.set("n", "<space>d", vim.diagnostic.open_float, { desc = "Floating diagnostic" })
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||
vim.keymap.set("n", "gl", vim.diagnostic.setloclist, { desc = "Diagnostics on loclist" })
|
||||
vim.keymap.set("n", "gq", vim.diagnostic.setqflist, { desc = "Diagnostics on quickfix" })
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
133
home/modules/devtools/neovim/lsp.nix
Normal file
133
home/modules/devtools/neovim/lsp.nix
Normal file
@@ -0,0 +1,133 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
# LSP and completions for injected langs
|
||||
otter-nvim
|
||||
phpactor
|
||||
# LSP
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
function add_lsp(server, options)
|
||||
if not options["cmd"] then
|
||||
options["cmd"] = server["document_config"]["default_config"]["cmd"]
|
||||
end
|
||||
if not options["capabilities"] then
|
||||
options["capabilities"] = require("cmp_nvim_lsp").default_capabilities()
|
||||
end
|
||||
|
||||
if vim.fn.executable(options["cmd"][1]) == 1 then
|
||||
server.setup(options)
|
||||
end
|
||||
end
|
||||
|
||||
-- Other LSPs
|
||||
add_lsp(lspconfig.bashls, {})
|
||||
add_lsp(lspconfig.clangd, {})
|
||||
add_lsp(lspconfig.dartls, {})
|
||||
add_lsp(lspconfig.dockerls, {})
|
||||
add_lsp(lspconfig.gopls, {})
|
||||
add_lsp(lspconfig.hls, {})
|
||||
add_lsp(lspconfig.jdtls, {})
|
||||
add_lsp(lspconfig.kotlin_language_server, {})
|
||||
add_lsp(lspconfig.phpactor, { init_options = { ["language_server_php_cs_fixer.enabled"] = true } })
|
||||
add_lsp(lspconfig.rust_analyzer, {})
|
||||
add_lsp(lspconfig.nixd, {})
|
||||
add_lsp(lspconfig.lua_ls, {})
|
||||
add_lsp(lspconfig.pylsp, {})
|
||||
add_lsp(lspconfig.solargraph, {})
|
||||
add_lsp(lspconfig.terraformls, {})
|
||||
add_lsp(lspconfig.texlab, { chktex = {
|
||||
onEdit = true,
|
||||
onOpenAndSave = true,
|
||||
} })
|
||||
add_lsp(lspconfig.tsserver, {})
|
||||
add_lsp(lspconfig.typst_lsp, {})
|
||||
add_lsp(lspconfig.elixirls, { cmd = { "elixir-ls" } })
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = ltex_extra-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local ltex_extra = require("ltex_extra")
|
||||
add_lsp(lspconfig.ltex, {
|
||||
on_attach = function(client, bufnr)
|
||||
ltex_extra.setup({
|
||||
path = vim.fn.expand("~") .. "/.local/state/ltex",
|
||||
})
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
|
||||
# Snippets
|
||||
luasnip
|
||||
|
||||
# Completions
|
||||
cmp-nvim-lsp
|
||||
cmp_luasnip
|
||||
cmp-rg
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
{
|
||||
plugin = cmp-git;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("cmp_git").setup({})
|
||||
'';
|
||||
}
|
||||
|
||||
lspkind-nvim
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = require("lspkind").cmp_format({
|
||||
before = function(entry, vim_item)
|
||||
return vim_item
|
||||
end,
|
||||
}),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({}),
|
||||
sources = {
|
||||
{ name = "otter" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "git" },
|
||||
{ name = "buffer", option = { get_bufnrs = vim.api.nvim_list_bufs } },
|
||||
{ name = "path" },
|
||||
{ name = "rg" },
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
38
home/modules/devtools/neovim/plugins/alpha.nix
Normal file
38
home/modules/devtools/neovim/plugins/alpha.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = alpha-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
dashboard.section.header.opts.hl = "Title"
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("n", " New file", ":enew<CR>"),
|
||||
dashboard.button("e", " Explore", ":Explore<CR>"),
|
||||
dashboard.button("g", " Git summary", ":Git | :only<CR>"),
|
||||
dashboard.button("c", " Nix config flake", ":e ~/.nix-config/flake.nix<CR>"),
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
vim.keymap.set("n", "<space>h", ":Alpha<CR>", { desc = "Open home dashboard" })
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/autopairs.nix
Normal file
15
home/modules/devtools/neovim/plugins/autopairs.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-autopairs").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/bqf.nix
Normal file
15
home/modules/devtools/neovim/plugins/bqf.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-bqf;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("bqf").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/bufferline.nix
Normal file
15
home/modules/devtools/neovim/plugins/bufferline.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = bufferline-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("bufferline").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/colorizer.nix
Normal file
15
home/modules/devtools/neovim/plugins/colorizer.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-colorizer-lua;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("colorizer").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
22
home/modules/devtools/neovim/plugins/comment.nix
Normal file
22
home/modules/devtools/neovim/plugins/comment.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = comment-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("Comment").setup({
|
||||
opleader = {
|
||||
line = "<C-b>",
|
||||
},
|
||||
toggler = {
|
||||
line = "<C-b>",
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
47
home/modules/devtools/neovim/plugins/conform.nix
Normal file
47
home/modules/devtools/neovim/plugins/conform.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = conform-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("conform").setup({
|
||||
default_format_opts = {
|
||||
timeout_ms = 3000,
|
||||
async = false, -- not recommended to change
|
||||
quiet = false, -- not recommended to change
|
||||
lsp_format = "fallback", -- not recommended to change
|
||||
},
|
||||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
css = { "prettierd" },
|
||||
html = { "prettierd" },
|
||||
javascript = { "prettierd" },
|
||||
json = { "fixjson" },
|
||||
lua = { "stylua" },
|
||||
nix = { "alejandra" },
|
||||
php = { "php_cs_fixer" },
|
||||
python = { "black" },
|
||||
rust = { "rustfmt" },
|
||||
sh = { "shfmt" },
|
||||
typescript = { "prettierd" },
|
||||
query = { "sql_formatter" },
|
||||
yaml = { "prettierd" },
|
||||
["*"] = { "injected" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Optionally, set up a command or auto-command to format on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
require("conform").format()
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
45
home/modules/devtools/neovim/plugins/copilot.nix
Normal file
45
home/modules/devtools/neovim/plugins/copilot.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = copilot-lua;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = true,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>",
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right
|
||||
ratio = 0.4,
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
hide_during_completion = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-CR>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
25
home/modules/devtools/neovim/plugins/default.nix
Normal file
25
home/modules/devtools/neovim/plugins/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
vim-illuminate
|
||||
];
|
||||
imports = [
|
||||
./alpha.nix
|
||||
./bufferline.nix
|
||||
./comment.nix
|
||||
./copilot.nix
|
||||
./fidget.nix
|
||||
./gitsigns.nix
|
||||
./treesitter.nix
|
||||
./conform.nix
|
||||
./gx.nix
|
||||
./bqf.nix
|
||||
./colorizer.nix
|
||||
./web-devicons.nix
|
||||
./oil.nix
|
||||
./lualine.nix
|
||||
./range-highlight.nix
|
||||
./fugitive.nix
|
||||
./which-key.nix
|
||||
./autopairs.nix
|
||||
];
|
||||
}
|
||||
21
home/modules/devtools/neovim/plugins/fidget.nix
Normal file
21
home/modules/devtools/neovim/plugins/fidget.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = fidget-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("fidget").setup({
|
||||
progress = {
|
||||
display = {
|
||||
progress_icon = { pattern = "dots", period = 1 },
|
||||
},
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/fugitive.nix
Normal file
15
home/modules/devtools/neovim/plugins/fugitive.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = vim-fugitive;
|
||||
type = "viml";
|
||||
config =
|
||||
/*
|
||||
vim
|
||||
*/
|
||||
''
|
||||
nmap <space>G :Git<CR>
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
23
home/modules/devtools/neovim/plugins/gitsigns.nix
Normal file
23
home/modules/devtools/neovim/plugins/gitsigns.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
28
home/modules/devtools/neovim/plugins/gx.nix
Normal file
28
home/modules/devtools/neovim/plugins/gx.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{pkgs, ...}: let
|
||||
gx-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "gx-nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "chrishrb";
|
||||
repo = "gx.nvim";
|
||||
rev = "f29a87454b02880e0d76264c21be8316224a7395";
|
||||
hash = "sha256-QWJ/cPvSyMTJoWLg51BNFf9+/9i7G+nzennpHP/eQ4g=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
programs.neovim.plugins = [
|
||||
{
|
||||
plugin = gx-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("gx").setup({})
|
||||
vim.keymap.set({ "n", "x" }, "gx", ":Browse<CR>", {
|
||||
desc = "Open the file under cursor with system app",
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
54
home/modules/devtools/neovim/plugins/lualine.nix
Normal file
54
home/modules/devtools/neovim/plugins/lualine.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = lualine-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "gruvbox-material",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
51
home/modules/devtools/neovim/plugins/none-ls.nix
Normal file
51
home/modules/devtools/neovim/plugins/none-ls.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim = {
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
none-ls-nvim
|
||||
plenary-nvim
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
extraConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Require necessary plugins
|
||||
require("plenary")
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
-- Setup null-ls with stylua and other formatters
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.alejandra,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.phpcsfixer,
|
||||
null_ls.builtins.formatting.pint,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.sql_formatter,
|
||||
null_ls.builtins.formatting.xmllint,
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
},
|
||||
})
|
||||
|
||||
-- Function to format on save
|
||||
local function format_on_save()
|
||||
vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format({ async = true })]])
|
||||
end
|
||||
|
||||
-- Call the function to enable auto format on save
|
||||
format_on_save()
|
||||
'';
|
||||
};
|
||||
}
|
||||
35
home/modules/devtools/neovim/plugins/oil.nix
Normal file
35
home/modules/devtools/neovim/plugins/oil.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = oil-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("oil").setup({
|
||||
buf_options = {
|
||||
buflisted = true,
|
||||
bufhidden = "delete",
|
||||
},
|
||||
cleanup_delay_ms = false,
|
||||
use_default_keymaps = false,
|
||||
keymaps = {
|
||||
["<CR>"] = "actions.select",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["gc"] = "actions.close",
|
||||
["gr"] = "actions.refresh",
|
||||
["gs"] = "actions.change_sort",
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
["g\\"] = "actions.toggle_trash",
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/plenary.nix
Normal file
15
home/modules/devtools/neovim/plugins/plenary.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = plenary-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("plenary").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/range-highlight.nix
Normal file
15
home/modules/devtools/neovim/plugins/range-highlight.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = range-highlight-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("range-highlight").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
20
home/modules/devtools/neovim/plugins/treesitter.nix
Normal file
20
home/modules/devtools/neovim/plugins/treesitter.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-treesitter.withAllGrammars;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/web-devicons.nix
Normal file
15
home/modules/devtools/neovim/plugins/web-devicons.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-web-devicons;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("nvim-web-devicons").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
15
home/modules/devtools/neovim/plugins/which-key.nix
Normal file
15
home/modules/devtools/neovim/plugins/which-key.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
programs.neovim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = which-key-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
require("which-key").setup({})
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
54
home/modules/devtools/neovim/syntaxes.nix
Normal file
54
home/modules/devtools/neovim/syntaxes.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.neovim = {
|
||||
extraConfig =
|
||||
lib.mkAfter # vim
|
||||
|
||||
''
|
||||
function! SetCustomKeywords()
|
||||
syn match Todo /TODO/
|
||||
syn match Done /DONE/
|
||||
syn match Start /START/
|
||||
syn match End /END/
|
||||
endfunction
|
||||
|
||||
autocmd Syntax * call SetCustomKeywords()
|
||||
'';
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
rust-vim
|
||||
dart-vim-plugin
|
||||
plantuml-syntax
|
||||
vim-markdown
|
||||
vim-nix
|
||||
vim-toml
|
||||
kotlin-vim
|
||||
haskell-vim
|
||||
pgsql-vim
|
||||
vim-terraform
|
||||
vim-jsx-typescript
|
||||
vim-caddyfile
|
||||
|
||||
{
|
||||
plugin = vimtex;
|
||||
config = let
|
||||
viewMethod =
|
||||
if config.programs.zathura.enable
|
||||
then "zathura"
|
||||
else "general";
|
||||
in
|
||||
/*
|
||||
vim
|
||||
*/
|
||||
''
|
||||
let g:vimtex_view_method = '${viewMethod}'
|
||||
"Don't open automatically
|
||||
let g:vimtex_quickfix_mode = 0
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,16 +1,28 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
enable_wayland = "true";
|
||||
# weztermPkg = pkgs.wezterm;
|
||||
weztermFlake = inputs.wezterm.packages.${pkgs.system}.default;
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.terminal.wezterm;
|
||||
in {
|
||||
options = {
|
||||
modules.terminal.wezterm.enable = mkEnableOption "Enables wezterm terminal";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
package = weztermFlake;
|
||||
extraConfig = ''
|
||||
extraConfig =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local wezterm = require 'wezterm';
|
||||
|
||||
local config = {
|
||||
@@ -19,8 +31,9 @@ in {
|
||||
check_for_updates = false,
|
||||
color_scheme = 'Gruvbox Material (Gogh)',
|
||||
default_cursor_style = 'SteadyBar',
|
||||
enable_scroll_bar = true,
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
enable_scroll_bar = false,
|
||||
enable_tab_bar = false,
|
||||
use_fancy_tab_bar = false,
|
||||
scrollback_lines = 10000,
|
||||
window_background_opacity = 0.9,
|
||||
}
|
||||
@@ -41,4 +54,5 @@ in {
|
||||
return config
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
package = inputs.wezterm.packages.${pkgs.system}.default;
|
||||
|
||||
extraConfig = ''
|
||||
return {
|
||||
enable_wayland = true,
|
||||
font = wezterm.font("Input Mono Compressed"),
|
||||
font_size = 12,
|
||||
check_for_updates = false,
|
||||
color_scheme = 'Gruvbox Material (Gogh)',
|
||||
default_cursor_style = 'SteadyBar',
|
||||
enable_scroll_bar = true,
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
scrollback_lines = 10000,
|
||||
window_background_opacity = 0.9,
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
61
home/modules/utils/zathura/default.nix
Normal file
61
home/modules/utils/zathura/default.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.utils.zathura;
|
||||
in {
|
||||
options = {
|
||||
modules.utils.zathura.enable = mkEnableOption "Enables zathura";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.zathura = {
|
||||
enable = true;
|
||||
options = {
|
||||
selection-clipboard = "clipboard";
|
||||
notification-error-bg = "rgba(40,40,40,1)";
|
||||
notification-error-fg = "rgba(251,73,52,1)";
|
||||
notification-warning-bg = "rgba(40,40,40,1)";
|
||||
notification-warning-fg = "rgba(250,189,47,1)";
|
||||
notification-bg = "rgba(40,40,40,1)";
|
||||
notification-fg = "rgba(184,187,38,1)";
|
||||
|
||||
completion-bg = "rgba(80,73,69,1)";
|
||||
completion-fg = "rgba(235,219,178,1)";
|
||||
completion-group-bg = "rgba(60,56,54,1)";
|
||||
completion-group-fg = "rgba(146,131,116,1)";
|
||||
completion-highlight-bg = "rgba(131,165,152,1)";
|
||||
completion-highlight-fg = "rgba(80,73,69,1)";
|
||||
|
||||
index-bg = "rgba(80,73,69,1)";
|
||||
index-fg = "rgba(235,219,178,1)";
|
||||
index-active-bg = "rgba(131,165,152,1)";
|
||||
index-active-fg = "rgba(80,73,69,1)";
|
||||
|
||||
inputbar-bg = "rgba(40,40,40,1)";
|
||||
inputbar-fg = "rgba(235,219,178,1)";
|
||||
|
||||
statusbar-bg = "rgba(80,73,69,1)";
|
||||
statusbar-fg = "rgba(235,219,178,1)";
|
||||
|
||||
highlight-color = "rgba(250,189,47,0.5)";
|
||||
highlight-active-color = "rgba(254,128,25,0.5)";
|
||||
|
||||
default-bg = "rgba(40,40,40,1)";
|
||||
default-fg = "rgba(235,219,178,1)";
|
||||
render-loading = true;
|
||||
render-loading-bg = "rgba(40,40,40,1)";
|
||||
render-loading-fg = "rgba(235,219,178,1)";
|
||||
|
||||
recolor-lightcolor = "rgba(40,40,40,1)";
|
||||
recolor-darkcolor = "rgba(235,219,178,1)";
|
||||
recolor = true;
|
||||
recolor-keephue = true;
|
||||
};
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
"application/pdf" = "org.pwmt.zathura.desktop";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,14 +12,14 @@ in {
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
"$terminal" = "kitty";
|
||||
"$terminal" = "wezterm";
|
||||
"$fileManager" = "thunar";
|
||||
"$passwordManager" = "keepassxc";
|
||||
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
|
||||
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
|
||||
"$browser" = "firefox";
|
||||
"$browserinc" = "firefox --private-window";
|
||||
"$yazi" = "alacritty -e yazi";
|
||||
"$yazi" = "wezterm -e yazi";
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
"$mod" = "SUPER";
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.wm.utils.hypridle;
|
||||
|
||||
hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle;
|
||||
# hypridlePkg = pkgs.hypridle;
|
||||
in {
|
||||
options = {
|
||||
modules.wm.utils.hypridle.enable = mkEnableOption "Enables hypridle";
|
||||
@@ -12,6 +17,7 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
package = hypridleFlake;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "hyprlock";
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.wm.utils.hyprlock;
|
||||
|
||||
hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
|
||||
# hyprlockPkg = pkgs.hyprlock;
|
||||
in {
|
||||
options = {
|
||||
modules.wm.utils.hyprlock.enable = mkEnableOption "Enables hyprlock";
|
||||
@@ -14,7 +17,7 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
package = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
|
||||
package = hyprlockFlake;
|
||||
settings = {
|
||||
general = {
|
||||
disable_loading_bar = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.wm.utils.hyprpaper;
|
||||
|
||||
hyprpaperFlake = inputs.hyprpaper.packages.${pkgs.system}.default;
|
||||
# hyprpaperPkg = pkgs.hyprpaper;
|
||||
in {
|
||||
options = {
|
||||
modules.wm.utils.hyprpaper.enable = mkEnableOption "Enables hyprpaper";
|
||||
@@ -12,6 +17,7 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
package = hyprpaperFlake;
|
||||
settings = {
|
||||
ipc = "on";
|
||||
splash = false;
|
||||
|
||||
@@ -14,73 +14,8 @@
|
||||
};
|
||||
};
|
||||
devtools = {
|
||||
nixvim = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
plugins = {
|
||||
barbar = {
|
||||
enable = false;
|
||||
};
|
||||
comment = {
|
||||
enable = true;
|
||||
};
|
||||
conform = {
|
||||
enable = false;
|
||||
};
|
||||
cmp = {
|
||||
enable = true;
|
||||
};
|
||||
copilot = {
|
||||
enable = false;
|
||||
};
|
||||
efm = {
|
||||
enable = true;
|
||||
};
|
||||
floaterm = {
|
||||
enable = false;
|
||||
};
|
||||
harpoon = {
|
||||
enable = false;
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
};
|
||||
lightline = {
|
||||
enable = false;
|
||||
};
|
||||
lualine = {
|
||||
enable = true;
|
||||
};
|
||||
markdown-preview = {
|
||||
enable = true;
|
||||
};
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
};
|
||||
none-ls = {
|
||||
enable = false;
|
||||
};
|
||||
rustaceanvim = {
|
||||
enable = true;
|
||||
};
|
||||
startify = {
|
||||
enable = true;
|
||||
};
|
||||
tagbar = {
|
||||
enable = false;
|
||||
};
|
||||
telescope = {
|
||||
enable = true;
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
};
|
||||
vimtex = {
|
||||
enable = false;
|
||||
};
|
||||
yanky = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
vscode = {
|
||||
enable = false;
|
||||
|
||||
@@ -14,77 +14,15 @@
|
||||
};
|
||||
};
|
||||
devtools = {
|
||||
nixvim = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
plugins = {
|
||||
barbar = {
|
||||
enable = false;
|
||||
};
|
||||
comment = {
|
||||
enable = true;
|
||||
};
|
||||
conform = {
|
||||
enable = false;
|
||||
};
|
||||
cmp = {
|
||||
enable = true;
|
||||
};
|
||||
copilot = {
|
||||
enable = true;
|
||||
};
|
||||
efm = {
|
||||
enable = true;
|
||||
};
|
||||
floaterm = {
|
||||
enable = false;
|
||||
};
|
||||
harpoon = {
|
||||
enable = false;
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
};
|
||||
lightline = {
|
||||
enable = false;
|
||||
};
|
||||
lualine = {
|
||||
enable = true;
|
||||
};
|
||||
markdown-preview = {
|
||||
enable = true;
|
||||
};
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
};
|
||||
none-ls = {
|
||||
enable = false;
|
||||
};
|
||||
rustaceanvim = {
|
||||
enable = true;
|
||||
};
|
||||
startify = {
|
||||
enable = true;
|
||||
};
|
||||
tagbar = {
|
||||
enable = false;
|
||||
};
|
||||
telescope = {
|
||||
enable = true;
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
};
|
||||
vimtex = {
|
||||
enable = false;
|
||||
};
|
||||
yanky = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
vscode = {
|
||||
enable = false;
|
||||
};
|
||||
helix = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
gaming = {
|
||||
lutris = {
|
||||
@@ -104,6 +42,9 @@
|
||||
kitty = {
|
||||
enable = true;
|
||||
};
|
||||
wezterm = {
|
||||
enable = true;
|
||||
};
|
||||
zellij = {
|
||||
enable = false;
|
||||
};
|
||||
@@ -135,6 +76,9 @@
|
||||
yazi = {
|
||||
enable = true;
|
||||
};
|
||||
zathura = {
|
||||
enable = true;
|
||||
};
|
||||
misc = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
@@ -14,73 +14,8 @@
|
||||
};
|
||||
};
|
||||
devtools = {
|
||||
nixvim = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
plugins = {
|
||||
barbar = {
|
||||
enable = false;
|
||||
};
|
||||
comment = {
|
||||
enable = true;
|
||||
};
|
||||
conform = {
|
||||
enable = false;
|
||||
};
|
||||
cmp = {
|
||||
enable = true;
|
||||
};
|
||||
copilot = {
|
||||
enable = false;
|
||||
};
|
||||
efm = {
|
||||
enable = true;
|
||||
};
|
||||
floaterm = {
|
||||
enable = false;
|
||||
};
|
||||
harpoon = {
|
||||
enable = false;
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
};
|
||||
lightline = {
|
||||
enable = false;
|
||||
};
|
||||
lualine = {
|
||||
enable = true;
|
||||
};
|
||||
markdown-preview = {
|
||||
enable = true;
|
||||
};
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
};
|
||||
none-ls = {
|
||||
enable = false;
|
||||
};
|
||||
rustaceanvim = {
|
||||
enable = true;
|
||||
};
|
||||
startify = {
|
||||
enable = true;
|
||||
};
|
||||
tagbar = {
|
||||
enable = false;
|
||||
};
|
||||
telescope = {
|
||||
enable = true;
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
};
|
||||
vimtex = {
|
||||
enable = false;
|
||||
};
|
||||
yanky = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
vscode = {
|
||||
enable = true;
|
||||
|
||||
@@ -104,6 +104,9 @@
|
||||
udisks = {
|
||||
enable = true;
|
||||
};
|
||||
pcscd = {
|
||||
enable = true;
|
||||
};
|
||||
xserver = {
|
||||
amd = {
|
||||
hhkbse = {
|
||||
@@ -140,6 +143,9 @@
|
||||
npm = {
|
||||
enable = true;
|
||||
};
|
||||
yubikey = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
./toothpc
|
||||
"${mod}/boot/lanzaboote"
|
||||
"${mod}/nix/nh/toothpc"
|
||||
"${mod}/dev"
|
||||
{
|
||||
home-manager = {
|
||||
users.toothpick.imports = homeImports."toothpick@toothpc";
|
||||
@@ -63,7 +64,6 @@
|
||||
}
|
||||
inputs.chaotic.nixosModules.default
|
||||
inputs.agenix.nixosModules.default
|
||||
(import "${mod}/dev")
|
||||
];
|
||||
};
|
||||
adampad = nixosSystem {
|
||||
@@ -74,6 +74,7 @@
|
||||
./adampad
|
||||
"${mod}/boot"
|
||||
"${mod}/nix/nh/adampad"
|
||||
"${mod}/dev"
|
||||
{
|
||||
home-manager = {
|
||||
users.adam.imports = homeImports."adam@adampad";
|
||||
|
||||
@@ -22,13 +22,30 @@
|
||||
# Aquamarine: Hyprland's new compositor library
|
||||
aquamarine # Aquamarine compositor library for Wayland
|
||||
|
||||
# Other utilities and tools
|
||||
openssl # Required for some crates that involve networking or encryption
|
||||
alejandra
|
||||
# Language servers, other utilities and tools
|
||||
gcc
|
||||
lua-language-server
|
||||
nixd
|
||||
openssl
|
||||
php
|
||||
php84Packages.php-cs-fixer
|
||||
# nixd
|
||||
# pyright
|
||||
# yaml-language-server
|
||||
# lua-language-server
|
||||
phpactor
|
||||
python312Packages.python-lsp-server
|
||||
bash-language-server
|
||||
nil
|
||||
nodePackages.vscode-langservers-extracted
|
||||
clang-tools
|
||||
marksman
|
||||
pyright
|
||||
|
||||
# Formatters
|
||||
alejandra
|
||||
stylua
|
||||
nodePackages_latest.fixjson
|
||||
nodePackages_latest.sql-formatter
|
||||
prettierd
|
||||
shfmt
|
||||
luaformatter
|
||||
black
|
||||
];
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"${systemModules}/sysd/powerd"
|
||||
"${systemModules}/sysd/samba"
|
||||
"${systemModules}/sysd/ssh"
|
||||
"${systemModules}/sysd/pcscd"
|
||||
"${systemModules}/sysd/udisks"
|
||||
"${systemModules}/sysd/xserver/amd"
|
||||
"${systemModules}/sysd/xserver/amd/hhkbse"
|
||||
@@ -35,8 +36,9 @@
|
||||
"${systemModules}/utils/anyrun"
|
||||
"${systemModules}/utils/corectrl"
|
||||
"${systemModules}/utils/microfetch"
|
||||
"${systemModules}/utils/nix-ld"
|
||||
"${systemModules}/utils/misc"
|
||||
"${systemModules}/utils/nix-ld"
|
||||
"${systemModules}/utils/npm"
|
||||
"${systemModules}/utils/yubikey"
|
||||
];
|
||||
}
|
||||
|
||||
15
system/modules/sysd/pcscd/default.nix
Normal file
15
system/modules/sysd/pcscd/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.sysd.pcscd;
|
||||
in {
|
||||
options = {
|
||||
modules.sysd.pcscd.enable = mkEnableOption "Enables pcscd";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.pcscd.enable = true;
|
||||
};
|
||||
}
|
||||
22
system/modules/utils/yubikey/default.nix
Normal file
22
system/modules/utils/yubikey/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.modules.utils.yubikey;
|
||||
in {
|
||||
options = {
|
||||
modules.utils.yubikey.enable = mkEnableOption "Enables yubikey utilities";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
pkgs.yubioath-flutter
|
||||
pkgs.yubikey-manager
|
||||
pkgs.yubikey-personalization
|
||||
pkgs.yubikey-personalization-gui
|
||||
pkgs.pcsc-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user