This commit is contained in:
cnst
2024-10-17 20:06:17 +02:00
parent f70061cc24
commit ec57cb7599
196 changed files with 1150 additions and 1271 deletions

View File

@@ -0,0 +1,25 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.browsers.chromium;
in {
options = {
home.browsers.chromium.enable = mkEnableOption "Enables chromium";
};
config = mkIf cfg.enable {
programs.chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
extensions = [
"gebbhagfogifgggkldgodflihgfeippi" # return youtube dislike
"mnjggcdmjocbbbhaepdhchncahnbgone" # sponsorblock for youtube
"ponfpcnoihfmfllpaingbgckeeldkhle" # enhancer for youtube
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
];
};
};
}

View File

@@ -0,0 +1,55 @@
{
inputs,
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.browsers.firefox;
in {
imports = [
inputs.nur.hmModules.nur
];
options = {
home.browsers.firefox.enable = mkEnableOption "Enables firefox";
};
config = mkIf cfg.enable {
programs.firefox = {
enable = true;
package = pkgs.firefox;
profiles = {
default = {
search = {
force = true;
default = "DuckDuckGo";
privateDefault = "DuckDuckGo";
order = ["DuckDuckGo" "Google"];
};
bookmarks = {};
extensions = with config.nur.repos.rycee.firefox-addons; [
ublock-origin
sponsorblock
clearurls
swedish-dictionary
reddit-enhancement-suite
return-youtube-dislikes
# enhancer-for-youtube # unfree
];
settings = {
"apz.overscroll.enabled" = true;
"browser.aboutConfig.showWarning" = false;
"general.autoScroll" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
};
};
};
xdg.mimeApps.defaultApplications = {
"text/html" = ["firefox.desktop"];
"text/xml" = ["firefox.desktop"];
"x-scheme-handler/http" = ["firefox.desktop"];
"x-scheme-handler/https" = ["firefox.desktop"];
};
};
}

View File

@@ -0,0 +1,57 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.comm.discord;
in {
options = {
home.comm.discord.enable = mkEnableOption "Enables discord";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [vesktop];
xdg.configFile."vesktop/themes/base16.css".text =
/*
css
*/
''
/**
* @name Material Gruvbox
* @.
* @author Costeer
* @version 1.5.0
* @website https://github.com/Costeer
* @source https://github.com/Costeer/Gruvbox-Material-Themes
*/
@import url(https://mwittrien.github.io/BetterDiscordAddons/Themes/DiscordRecolor/DiscordRecolor.css);
:root {
--accentcolor: 137, 180, 130;
--accentcolor2: 211, 134, 155;
--linkcolor: 125, 174, 163;
--mentioncolor: 211, 134, 155;
--textbrightest: 221, 199, 161;
--textbrighter: 212, 190, 152;
--textbright: 168, 153, 132;
--textdark: 146, 131, 116;
--textdarker: 146, 131, 116;
--textdarkest: 80, 80, 80;
--font: Input Sans Narrow;
--main-font: Input Sans Narrow;
--code-font: Input Mono Compressed;
--backgroundaccent: 80, 73, 69;
--backgroundprimary: 60, 56, 54;
--backgroundsecondary: 50, 48, 47;
--backgroundsecondaryalt: 40, 40, 40;
--backgroundtertiary: 29, 32, 33;
--backgroundfloating: 20, 22, 23;
--settingsicons: 1;
}
'';
};
}

View File

@@ -0,0 +1,139 @@
{
inputs,
pkgs,
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.devtools.helix;
in {
imports = [
./lang.nix
./theme.nix
];
options = {
home.devtools.helix.enable = mkEnableOption "Enable helix";
};
config = mkIf cfg.enable {
programs.helix = {
enable = true;
# package = inputs.helix.packages.${pkgs.system}.default;
package = inputs.helix-flake.packages.${pkgs.system}.default;
settings = {
theme = "gruvbox_custom";
editor = {
color-modes = true;
scrolloff = 0;
cursorline = true;
completion-replace = true;
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
indent-guides.render = false;
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
gutters = ["diagnostics" "line-numbers" "spacer" "diff"];
statusline = {
separator = "of";
left = [
"mode"
"selections"
"file-type"
"register"
"spinner"
"diagnostics"
];
center = ["file-name"];
right = [
"file-encoding"
"file-line-ending"
"position-percentage"
"spacer"
"separator"
"total-line-numbers"
];
mode = {
normal = "NOR";
insert = "INS";
select = "SEL";
};
};
true-color = true;
whitespace.characters = {
newline = "";
tab = "";
};
};
keys = let
spaceMode = {
space = "file_picker";
n = "global_search";
f = ":format";
c = "toggle_comments";
t = {
d = "goto_type_definition";
i = "goto_implementation";
r = "goto_reference";
t = "goto_definition";
w = "trim_selections";
};
x = ":buffer-close";
w = ":w";
q = ":q";
y = "yank";
p = "paste_after";
P = "paste_before";
R = "replace_with_yanked";
};
in {
normal = {
d = {
d = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "delete_selection"];
s = ["surround_delete"];
};
x = "delete_selection";
y = {
y = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "normal_mode" "collapse_selection"];
d = ":yank-diagnostic";
};
Y = ["extend_to_line_end" "yank_main_selection_to_clipboard" "collapse_selection"];
P = ["paste_clipboard_before" "collapse_selection"];
p = ["paste_clipboard_after" "collapse_selection"];
C-a = "select_all";
del = "delete_selection";
space = spaceMode;
};
insert = {
C-v = "paste_clipboard_after";
C-c = "yank_to_clipboard";
C-x = "completion";
del = "delete_selection";
esc = ["collapse_selection" "normal_mode"];
};
select = {
space = spaceMode;
d = ["yank_main_selection_to_clipboard" "delete_selection"];
x = ["yank_main_selection_to_clipboard" "delete_selection"];
y = ["yank_main_selection_to_clipboard" "normal_mode" "flip_selections" "collapse_selection"];
Y = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "goto_line_start" "collapse_selection" "normal_mode"];
p = ["replace_selections_with_clipboard"];
P = ["paste_clipboard_before"];
};
};
};
};
};
}

View File

@@ -0,0 +1,225 @@
{
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 = "nix";
auto-format = true;
file-types = ["nix"];
language-servers = ["nil"];
formatter = {
command = lib.getExe pkgs.alejandra;
args = ["-q"];
};
}
{
name = "json";
formatter = deno "json";
}
{
name = "common-lisp";
file-types = ["kbd"];
auto-format = true;
}
{
name = "markdown";
auto-format = true;
formatter = deno "md";
}
{
name = "python";
language-servers = ["pylsp"];
formatter = {
command = lib.getExe pkgs.black;
args = ["-" "--quiet" "--line-length 100"];
};
}
{
name = "typescript";
auto-format = true;
language-servers = ["dprint" "typescript-language-server"];
}
{
name = "php";
auto-format = true;
}
{
name = "css";
auto-format = true;
language-servers = ["vscode-css-language-server"];
}
{
name = "rust";
auto-format = true;
file-types = ["rs"];
language-servers = ["rust-analyzer"];
formatter = {
command = lib.getExe pkgs.rustfmt;
};
}
]
++ prettierLangs langs;
language-server = {
gpt = {
command = "helix-gpt";
args = ["--copilotApiKey" "cat /run/agenix/helix-gpt"];
};
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;
};
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-language-server";
args = ["--stdio"];
config = {
provideFormatter = true;
css.validate.enable = true;
scss.validate.enable = true;
};
};
};
};
}

View File

@@ -0,0 +1,201 @@
{
programs.helix.themes = {
gruvbox_custom = let
bg0 = "#32302f";
bg1 = "#3c3836";
bg2 = "#3c3836";
bg3 = "#504945";
bg4 = "#504945";
fg0 = "#d4be98";
red = "#ea6962";
orange = "#e78a4e";
yellow = "#d8a657";
bg_visual_yellow = "#574833";
green = "#a9b665";
aqua = "#89b482";
blue = "#7daea3";
purple = "#d3869b";
grey0 = "#7c6f64";
grey2 = "#a89984";
in {
"type" = yellow;
"constant" = purple;
"constant.numeric" = purple;
"constant.character.escape" = orange;
"string" = green;
"string.regexp" = blue;
"comment" = grey0;
"variable" = fg0;
"variable.builtin" = blue;
"variable.parameter" = fg0;
"variable.other.member" = fg0;
"label" = aqua;
"punctuation" = grey2;
"punctuation.delimiter" = grey2;
"punctuation.bracket" = fg0;
"keyword" = red;
"keyword.directive" = aqua;
"operator" = orange;
"function" = green;
"function.builtin" = blue;
"function.macro" = aqua;
"tag" = yellow;
"namespace" = aqua;
"attribute" = aqua;
"constructor" = yellow;
"module" = blue;
"special" = orange;
"markup.heading.marker" = grey2;
"markup.heading.1" = {
fg = red;
modifiers = ["bold"];
};
"markup.heading.2" = {
fg = orange;
modifiers = ["bold"];
};
"markup.heading.3" = {
fg = yellow;
modifiers = ["bold"];
};
"markup.heading.4" = {
fg = green;
modifiers = ["bold"];
};
"markup.heading.5" = {
fg = blue;
modifiers = ["bold"];
};
"markup.heading.6" = {
fg = fg0;
modifiers = ["bold"];
};
"markup.list" = red;
"markup.bold" = {modifiers = ["bold"];};
"markup.italic" = {modifiers = ["italic"];};
"markup.link.url" = {
fg = blue;
modifiers = ["underlined"];
};
"markup.link.text" = purple;
"markup.quote" = grey2;
"markup.raw" = green;
"diff.plus" = green;
"diff.delta" = orange;
"diff.minus" = red;
"ui.background" = {bg = bg0;};
"ui.background.separator" = grey0;
"ui.cursor" = {
fg = bg0;
bg = fg0;
};
"ui.cursor.match" = {
fg = orange;
bg = bg_visual_yellow;
};
"ui.cursor.insert" = {
fg = bg0;
bg = grey2;
};
"ui.cursor.select" = {
fg = bg0;
bg = blue;
};
"ui.cursorline.primary" = {bg = bg1;};
"ui.cursorline.secondary" = {bg = bg1;};
"ui.selection" = {bg = bg3;};
"ui.linenr" = grey0;
"ui.linenr.selected" = fg0;
"ui.statusline" = {
fg = fg0;
bg = bg3;
};
"ui.statusline.inactive" = {
fg = grey0;
bg = bg1;
};
"ui.statusline.normal" = {
fg = bg0;
bg = fg0;
modifiers = ["bold"];
};
"ui.statusline.insert" = {
fg = bg0;
bg = yellow;
modifiers = ["bold"];
};
"ui.statusline.select" = {
fg = bg0;
bg = blue;
modifiers = ["bold"];
};
"ui.bufferline" = {
fg = grey0;
bg = bg1;
};
"ui.bufferline.active" = {
fg = fg0;
bg = bg3;
modifiers = ["bold"];
};
"ui.popup" = {
fg = grey2;
bg = bg2;
};
"ui.window" = {
fg = grey0;
bg = bg0;
};
"ui.help" = {
fg = fg0;
bg = bg2;
};
"ui.text" = fg0;
"ui.text.focus" = fg0;
"ui.menu" = {
fg = fg0;
bg = bg3;
};
"ui.menu.selected" = {
fg = bg0;
bg = blue;
modifiers = ["bold"];
};
"ui.virtual.whitespace" = {fg = bg4;};
"ui.virtual.indent-guide" = {fg = bg4;};
"ui.virtual.ruler" = {bg = bg3;};
"hint" = blue;
"info" = aqua;
"warning" = yellow;
"error" = red;
"diagnostic" = {underline = {style = "curl";};};
"diagnostic.hint" = {
underline = {
color = blue;
style = "dotted";
};
};
"diagnostic.info" = {
underline = {
color = aqua;
style = "dotted";
};
};
"diagnostic.warning" = {
underline = {
color = yellow;
style = "curl";
};
};
"diagnostic.error" = {
underline = {
color = red;
style = "curl";
};
};
};
};
}

View File

@@ -0,0 +1,155 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.devtools.neovim;
in {
imports = [
./plugins
./lsp.nix
./syntaxes.nix
./keybindings.nix
];
options = {
home.devtools.neovim.enable = mkEnableOption "Enable neovim";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
extraLuaConfig =
/*
lua
*/
''
-- Use system clipboard
vim.opt.clipboard = "unnamedplus"
-- 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
];
};
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"
];
};
};
};
}

View 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" })
'';
};
};
}

View 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.ts_ls, {})
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" },
},
})
'';
}
];
}

View 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" })
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-autopairs;
type = "lua";
config =
/*
lua
*/
''
require("nvim-autopairs").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-bqf;
type = "lua";
config =
/*
lua
*/
''
require("bqf").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = bufferline-nvim;
type = "lua";
config =
/*
lua
*/
''
require("bufferline").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-colorizer-lua;
type = "lua";
config =
/*
lua
*/
''
require("colorizer").setup({})
'';
}
];
}

View 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>",
},
})
'';
}
];
}

View 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,
})
'';
}
];
}

View 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-]>",
},
},
})
'';
}
];
}

View File

@@ -0,0 +1,24 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
vim-illuminate
];
imports = [
./alpha.nix
./bufferline.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
];
}

View 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 },
},
},
})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = vim-fugitive;
type = "viml";
config =
/*
vim
*/
''
nmap <space>G :Git<CR>
'';
}
];
}

View 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 = "~" },
},
})
'';
}
];
}

View 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",
})
'';
}
];
}

View 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 = {},
})
'';
}
];
}

View 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()
'';
};
}

View 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",
},
})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = plenary-nvim;
type = "lua";
config =
/*
lua
*/
''
require("plenary").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = range-highlight-nvim;
type = "lua";
config =
/*
lua
*/
''
require("range-highlight").setup({})
'';
}
];
}

View 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,
},
})
'';
}
];
}

View 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({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = which-key-nvim;
type = "lua";
config =
/*
lua
*/
''
require("which-key").setup({})
'';
}
];
}

View 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
'';
}
];
};
}

View File

@@ -0,0 +1,31 @@
{
programs.nixvim.autoCmd = [
# Open help in a vertical split
{
event = "FileType";
pattern = "help";
command = "wincmd L";
}
# Enable spellcheck for some filetypes
{
event = "FileType";
pattern = [
"tex"
"latex"
"markdown"
];
command = "setlocal spell spelllang=en,se";
}
{
event = "TextYankPost";
desc = "Highlight when yanking (copying) text";
# group = "vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true })";
callback = {
__raw = "function()
vim.highlight.on_yank()
end";
};
}
];
}

View File

@@ -0,0 +1,150 @@
{
programs.nixvim = {
plugins = {
luasnip.enable = true;
cmp-buffer = {enable = true;};
cmp-emoji = {enable = true;};
cmp-nvim-lsp = {enable = true;};
cmp-path = {enable = true;};
cmp_luasnip = {enable = true;};
cmp = {
enable = true;
settings = {
experimental = {ghost_text = true;};
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{
name = "buffer";
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{name = "nvim_lua";}
{name = "path";}
{name = "copilot";}
];
formatting = {
fields = ["abbr" "kind" "menu"];
format =
# lua
''
function(_, item)
local icons = {
Namespace = "󰌗",
Text = "󰉿",
Method = "󰆧",
Function = "󰆧",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈚",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "󰊄",
Table = "",
Object = "󰅩",
Tag = "",
Array = "[]",
Boolean = "",
Number = "",
Null = "󰟢",
String = "󰉿",
Calendar = "",
Watch = "󰥔",
Package = "",
Copilot = "",
Codeium = "",
TabNine = "",
}
local icon = icons[item.kind] or ""
item.kind = string.format("%s %s", icon, item.kind or "")
return item
end
'';
};
window = {
completion = {
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
scrollbar = false;
sidePadding = 0;
border = ["" "" "" "" "" "" "" ""];
};
settings.documentation = {
border = ["" "" "" "" "" "" "" ""];
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
};
};
mapping = {
"<C-l>" = "cmp.mapping.select_prev_item()";
"<C-ä>" = "cmp.mapping.select_next_item()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<S-Tab>" = "cmp.mapping.close()";
"<Tab>" =
# lua
''
function(fallback)
local line = vim.api.nvim_get_current_line()
if line:match("^%s*$") then
fallback()
elseif cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
else
fallback()
end
end
'';
"<Down>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end
'';
"<Up>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end
'';
};
};
};
};
};
}

View File

@@ -0,0 +1,58 @@
{
config,
lib,
inputs,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.devtools.nixvim;
in {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./plugins
./autocmd.nix
./keymap.nix
./options.nix
./todo.nix
];
options = {
home.devtools.nixvim.enable = mkEnableOption "Enable nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [gruvbox-material-nvim nvim-web-devicons];
colorscheme = "gruvbox-material";
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
luaLoader.enable = true;
plugins = {
gitsigns.enable = true;
statuscol.enable = true;
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,94 @@
{
config,
lib,
...
}: {
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = let
normal =
lib.mapAttrsToList
(key: action: {
mode = "n";
inherit action key;
})
{
# "<C-c>" = "<cmd> %y+ <CR>";
"<C-v>" = "p";
"<C-a>" = "ggVG";
"<Space>" = "<NOP>";
# Esc to clear search results
"<esc>" = ":noh<CR>";
# fix Y behaviour
Y = "y$";
# back and fourth between the two most recent files
"<C-c>" = ":b#<CR>";
# close by Ctrl+x
"<C-x>" = ":close<CR>";
# save by Space+s or Ctrl+s
"<leader>s" = ":w<CR>";
"<C-s>" = ":w<CR>";
# navigate to left/right window
"<leader>h" = "<C-w>h";
"<leader>l" = "<C-w>l";
# Press 'H', 'L' to jump to start/end of a line (first/last character)
L = "$";
H = "^";
# resize with arrows
"<C-Up>" = ":resize -2<CR>";
"<C-Down>" = ":resize +2<CR>";
"<C-Left>" = ":vertical resize +2<CR>";
"<C-Right>" = ":vertical resize -2<CR>";
# move current line up/down
# M = Alt key
"<M-k>" = ":move-2<CR>";
"<M-j>" = ":move+<CR>";
"<leader>rp" = ":!remi push<CR>";
};
visual =
lib.mapAttrsToList
(key: action: {
mode = "v";
inherit action key;
})
{
"<C-c>" = "y";
# better indenting
">" = ">gv";
"<" = "<gv";
"<TAB>" = ">gv";
"<S-TAB>" = "<gv";
# move selected line / block of text in visual mode
"K" = ":m '<-2<CR>gv=gv";
"J" = ":m '>+1<CR>gv=gv";
};
insert =
lib.mapAttrsToList
(key: action: {
mode = "i";
inherit action key;
})
{
"<C-v>" = "<esc>p";
};
in
config.lib.nixvim.keymaps.mkKeymaps
{options.silent = true;}
(normal ++ visual ++ insert);
};
}

View File

@@ -0,0 +1,72 @@
{
programs.nixvim = {
globals = {
# Disable useless providers
loaded_ruby_provider = 0; # Ruby
loaded_perl_provider = 0; # Perl
loaded_python_provider = 0; # Python 2
};
clipboard = {
# Use system clipboard
register = "unnamedplus";
providers.wl-copy.enable = true;
};
opts = {
updatetime = 100; # Faster completion
# Line numbers
relativenumber = false; # Relative line numbers
number = true; # Display the absolute line number of the current line
hidden = true; # Keep closed buffer open in the background
showmode = false;
mouse = "a"; # Enable mouse control
mousemodel = "popup"; # Mouse right-click extends the current selection
splitbelow = true; # A new window is put below the current one
splitright = true; # A new window is put right of the current one
list = true;
listchars = {
tab = " ";
trail = "·";
nbsp = "";
extends = "";
precedes = "";
};
swapfile = false; # Disable the swap file
modeline = true; # Tags such as 'vim:ft=sh'
modelines = 100; # Sets the type of modelines
undofile = true; # Automatically save and restore undo history
incsearch = true; # Incremental search: show match for partly typed search command
inccommand = "split"; # Search and replace: preview changes in quickfix list
ignorecase = true; # When the search query is lower-case, match both lower and upper-case
# patterns
smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper
# case characters
scrolloff = 4; # Number of screen lines to show around the cursor
cursorline = true; # Highlight the screen line of the cursor
cursorcolumn = false; # Highlight the screen column of the cursor
signcolumn = "yes"; # Whether to show the signcolumn
colorcolumn = ""; # Columns to highlight
laststatus = 3; # When to use a status line for the last window
fileencoding = "utf-8"; # File-content encoding for the current buffer
# termguicolors = true; # Enables 24-bit RGB color in the |TUI|
spell = false; # Highlight spelling mistakes (local to window)
wrap = false; # Prevent text from wrapping
# Tab options
tabstop = 4; # Number of spaces a <Tab> in the text stands for (local to buffer)
shiftwidth = 4; # Number of spaces used for each step of (auto)indent (local to buffer)
expandtab = true; # Expand <Tab> to spaces in Insert mode (local to buffer)
autoindent = true; # Do clever autoindenting
textwidth = 0; # Maximum width of text that is being inserted. A longer line will be
# broken after white space to get this width.
# Folding
foldlevel = 99; # Folds with a level higher than this number will be closed
};
};
}

View File

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

View File

@@ -0,0 +1,163 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.cmp;
in {
options = {
home.devtools.nixvim.plugins.cmp.enable = mkEnableOption "Enables completion plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
luasnip.enable = true;
cmp-buffer = {enable = true;};
cmp-emoji = {enable = true;};
cmp-nvim-lsp = {enable = true;};
cmp-path = {enable = true;};
cmp_luasnip = {enable = true;};
cmp = {
enable = true;
settings = {
experimental = {ghost_text = true;};
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{
name = "buffer";
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{name = "nvim_lua";}
{name = "path";}
{name = "copilot";}
];
formatting = {
fields = ["abbr" "kind" "menu"];
format =
# lua
''
function(_, item)
local icons = {
Namespace = "󰌗",
Text = "󰉿",
Method = "󰆧",
Function = "󰆧",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈚",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "󰊄",
Table = "",
Object = "󰅩",
Tag = "",
Array = "[]",
Boolean = "",
Number = "",
Null = "󰟢",
String = "󰉿",
Calendar = "",
Watch = "󰥔",
Package = "",
Copilot = "",
Codeium = "",
TabNine = "",
}
local icon = icons[item.kind] or ""
item.kind = string.format("%s %s", icon, item.kind or "")
return item
end
'';
};
window = {
completion = {
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
scrollbar = false;
sidePadding = 0;
border = ["" "" "" "" "" "" "" ""];
};
settings.documentation = {
border = ["" "" "" "" "" "" "" ""];
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
};
};
mapping = {
"<C-l>" = "cmp.mapping.select_prev_item()";
"<C-ä>" = "cmp.mapping.select_next_item()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<S-Tab>" = "cmp.mapping.close()";
"<Tab>" =
# lua
''
function(fallback)
local line = vim.api.nvim_get_current_line()
if line:match("^%s*$") then
fallback()
elseif cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
else
fallback()
end
end
'';
"<Down>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end
'';
"<Up>" =
# lua
''
function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end
'';
};
};
};
};
};
};
}

View File

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

View File

@@ -0,0 +1,44 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.conform;
in {
options = {
home.devtools.nixvim.plugins.conform.enable = mkEnableOption "Enables Conform plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.conform = {
enable = true;
settings = {
notify_on_error = true;
formatters_by_ft = {
html = ["prettierd" "prettier"];
css = ["prettierd" "prettier"];
javascript = ["prettierd" "prettier"];
javascriptreact = ["prettierd" "prettier"];
typescript = ["prettierd" "prettier"];
typescriptreact = ["prettierd" "prettier"];
python = ["black"];
lua = ["stylua"];
nix = ["alejandra"];
markdown = ["prettierd" "prettier"];
yaml = ["yamlfmt"];
rust = ["rustfmt"];
xml = ["xmllint"];
php = ["php-cs-fixer"];
};
stop_after_first = true;
};
};
home.packages = with pkgs; [
prettierd
yamlfmt
libxml2Python
];
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.copilot;
in {
options = {
home.devtools.nixvim.plugins.copilot.enable = mkEnableOption "Enables AI tools for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
copilot-chat = {
enable = true;
};
copilot-lua = {
enable = true;
suggestion = {
enabled = false;
autoTrigger = true;
keymap.accept = "<C-CR>";
};
panel.enabled = false;
};
};
keymaps = [
{
action = "<cmd>lua local input = vim.fn.input('Quick Chat: '); if input ~= '' then require('CopilotChat').ask(input, { selection = require('CopilotChat.select').buffer }) end<CR>";
key = "<leader>qc";
options = {
desc = "CopilotChat - Quick chat";
};
mode = [
"n"
];
}
{
action = "<cmd>CopilotChatToggle<CR>";
key = "<leader>ac";
options = {
desc = "Toggle Coilot chat";
};
mode = [
"n"
];
}
];
};
};
}

View File

@@ -0,0 +1,25 @@
{umodPath, ...}: {
imports = [
"${umodPath}/devtools/nixvim/plugins/barbar.nix"
"${umodPath}/devtools/nixvim/plugins/comment.nix"
"${umodPath}/devtools/nixvim/plugins/conform.nix"
"${umodPath}/devtools/nixvim/plugins/cmp.nix"
"${umodPath}/devtools/nixvim/plugins/copilot.nix"
"${umodPath}/devtools/nixvim/plugins/efm.nix"
"${umodPath}/devtools/nixvim/plugins/floaterm.nix"
"${umodPath}/devtools/nixvim/plugins/harpoon.nix"
"${umodPath}/devtools/nixvim/plugins/lsp.nix"
"${umodPath}/devtools/nixvim/plugins/lualine.nix"
"${umodPath}/devtools/nixvim/plugins/lightline.nix"
"${umodPath}/devtools/nixvim/plugins/markdown-preview.nix"
"${umodPath}/devtools/nixvim/plugins/neo-tree.nix"
"${umodPath}/devtools/nixvim/plugins/nonels.nix"
"${umodPath}/devtools/nixvim/plugins/rustaceanvim.nix"
"${umodPath}/devtools/nixvim/plugins/startify.nix"
"${umodPath}/devtools/nixvim/plugins/tagbar.nix"
"${umodPath}/devtools/nixvim/plugins/telescope.nix"
"${umodPath}/devtools/nixvim/plugins/treesitter.nix"
"${umodPath}/devtools/nixvim/plugins/vimtex.nix"
"${umodPath}/devtools/nixvim/plugins/yanky.nix"
];
}

View File

@@ -0,0 +1,112 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.efm;
in {
options = {
home.devtools.nixvim.plugins.efm.enable = mkEnableOption "Enables EFM LSP support for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins = {
lsp.servers.efm = {
enable = true;
extraOptions.init_options = {
documentFormatting = true;
documentRangeFormatting = true;
hover = true;
documentSymbol = true;
codeAction = true;
completion = true;
};
};
lsp-format = {
enable = true;
lspServersToEnable = ["efm"];
};
efmls-configs = {
enable = true;
toolPackages.mdformat = pkgs.mdformat.withPlugins (
ps:
with ps; [
# TODO: broken with update of mdformat
# mdformat-gfm
mdformat-frontmatter
mdformat-footnote
mdformat-tables
mdit-py-plugins
]
);
setup = {
sh = {
#linter = "shellcheck";
formatter = "shfmt";
};
bash = {
#linter = "shellcheck";
formatter = "shfmt";
};
c = {
linter = "cppcheck";
};
markdown = {
formatter = [
"cbfmt"
"mdformat"
];
};
python = {
formatter = "black";
};
nix = {
formatter = "alejandra";
linter = "statix";
};
lua = {
formatter = "stylua";
};
html = {
formatter = [
"prettier"
];
};
htmldjango = {
linter = "djlint";
};
json = {
formatter = "prettier";
};
css = {
formatter = "prettier";
};
scss = {
formatter = "prettier";
};
ts = {
formatter = "prettier";
};
gitcommit = {
linter = "gitlint";
};
php = {
formatter = "php_cs_fixer";
};
rust = {
formatter = "rustfmt";
};
sql = {
formatter = "sql-formatter";
};
};
};
};
};
}

View File

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

View File

@@ -0,0 +1,31 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.harpoon;
in {
options = {
home.devtools.nixvim.plugins.harpoon.enable = mkEnableOption "Enables Harpoon plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.harpoon = {
enable = true;
keymapsSilent = true;
keymaps = {
addFile = "<leader>a";
toggleQuickMenu = "<C-e>";
navFile = {
"1" = "<C-j>";
"2" = "<C-k>";
"3" = "<C-l>";
"4" = "<C-m>";
};
};
};
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.lightline;
in {
options = {
home.devtools.nixvim.plugins.lightline.enable = mkEnableOption "Enables lightline plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.lightline = {
enable = true;
settings = {
colorscheme = "apprentice";
active = {
right = [
[
"lineinfo"
]
[
"percent"
]
[
"fileformat"
"fileencoding"
"filetype"
]
];
};
component = {
charvaluehex = "0x%B";
lineinfo = "%3l:%-2v%<";
};
component_function = {
gitbranch = "FugitiveHead";
};
inactive = [];
mode_map = {
"<C-s>" = "SB";
"<C-v>" = "VB";
i = "I";
n = "N";
v = "V";
};
};
};
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.lsp-format;
in {
options = {
home.devtools.nixvim.plugins.lsp-format = {
enable = mkEnableOption "Enables LSP formatting support for nixvim";
};
};
config = mkIf cfg.enable {
programs.nixvim.plugins.lsp-format = {
enable = true;
lspServersToEnable = [
"rustfmt"
"prettier"
"prettierd"
"php-cs-fixer"
"alejandra"
"xmllint"
"black"
"yamlfmt"
"stylua"
];
};
};
}

View File

@@ -0,0 +1,76 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.lsp;
in {
options = {
home.devtools.nixvim.plugins.lsp = {
enable = mkEnableOption "Enables LSP support for nixvim";
};
};
config = mkIf cfg.enable {
programs.nixvim.plugins = {
lsp-format = {
enable = true;
lspServersToEnable = [
"rust-analyzer"
];
};
lsp = {
enable = true;
keymaps = {
silent = true;
diagnostic = {
"<leader>k" = "goto_prev";
"<leader>j" = "goto_next";
};
lspBuf = {
gd = "definition";
gD = "references";
gt = "type_definition";
gi = "implementation";
K = "hover";
"<F2>" = "rename";
};
};
servers = {
# Average webdev LSPs
cssls.enable = true; # CSS
tailwindcss.enable = true; # TailwindCSS
html.enable = true; # HTML
astro.enable = true; # AstroJS
phpactor.enable = true; # PHP
svelte.enable = false; # Svelte
vuels.enable = false; # Vue
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;
settings = {
telemetry.enable = false;
diagnostics = {
globals = ["vim"];
};
};
};
tsserver = {
enable = false; # TS/JS
};
};
};
};
};
}

View File

@@ -0,0 +1,69 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.lualine;
in {
options = {
home.devtools.nixvim.plugins.lualine.enable = mkEnableOption "Enables Lualine plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.lualine = {
enable = true;
theme = "gruvbox-material";
globalstatus = true;
sections = {
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = [
"diagnostics"
# Show active language server
{
name.__raw = ''
function()
local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
local non_null_ls_clients = {}
for _, client in ipairs(clients) do
if client.name ~= "null-ls" then
table.insert(non_null_ls_clients, client)
end
end
if #non_null_ls_clients > 0 then
for _, client in ipairs(non_null_ls_clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
else
for _, client in ipairs(clients) do
if client.name == "null-ls" then
return client.name
end
end
end
return msg
end
'';
icon = "";
color.fg = "#A89984";
}
"fileformat"
"filetype"
];
};
};
};
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,29 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.home.devtools.nixvim.plugins.rustaceanvim;
in {
options.home.devtools.nixvim.plugins.rustaceanvim = {
enable = mkEnableOption "Whether to enable rustaceanvim.";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins.rustaceanvim = {
enable = true;
settings.server = {
default_settings.rust-analyzer = {
cargo.features = "all";
checkOnSave = true;
check.command = "clippy";
rustc.source = "discover";
};
};
};
};
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.startify;
in {
options = {
home.devtools.nixvim.plugins.startify.enable = mkEnableOption "Enables Startify plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.startify = {
enable = true;
settings = {
custom_header = [
""
" "
" "
" "
" "
" "
" "
];
change_to_dir = false;
use_unicode = true;
lists = [{type = "dir";}];
files_number = 30;
skiplist = ["flake.lock"];
};
};
};
}

View File

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

View File

@@ -0,0 +1,42 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.telescope;
in {
options = {
home.devtools.nixvim.plugins.telescope.enable = mkEnableOption "Enables Telescope plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.telescope = {
enable = true;
keymaps = {
"<leader>ff" = "find_files";
"<leader>fg" = "live_grep";
"<leader>b" = "buffers";
"<leader>fh" = "help_tags";
"<leader>fd" = "diagnostics";
"<C-p>" = "git_files";
"<leader>p" = "oldfiles";
"<C-f>" = "live_grep";
};
settings.defaults = {
file_ignore_patterns = [
"^.git/"
"^.mypy_cache/"
"^__pycache__/"
"^output/"
"^data/"
"%.ipynb"
];
set_env.COLORTERM = "truecolor";
};
};
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.treesitter;
in {
options = {
home.devtools.nixvim.plugins = {
treesitter.enable = mkEnableOption "Enables Treesitter plugin for nixvim";
};
};
config = mkIf cfg.enable {
programs.nixvim.plugins = {
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;
};
};
};
}

View File

@@ -0,0 +1,78 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.vimtex;
in {
options = {
home.devtools.nixvim.plugins.vimtex.enable = mkEnableOption "Enables VimTeX plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins.vimtex = {
enable = true;
settings = {
view_method = "zathura";
quickfix_enabled = true;
quickfix_open_on_warning = false;
quickfix_ignore_filters = [
"Underfull"
"Overfull"
"specifier changed to"
"Token not allowed in a PDF string"
];
toc_config = {
name = "TOC";
layers = ["content" "todo"];
resize = true;
split_width = 50;
todo_sorted = false;
show_help = true;
show_numbers = true;
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)";
}
];
};
};
}

View File

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

View File

@@ -0,0 +1,26 @@
{
programs.nixvim = {
highlight.Todo = {
fg = "Blue";
bg = "Yellow";
};
match.TODO = "TODO";
keymaps = [
{
mode = "n";
key = "<C-t>";
action.__raw = ''
function()
require('telescope.builtin').live_grep({
default_text="TODO",
initial_mode="normal"
})
end
'';
options.silent = true;
}
];
};
}

View File

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

View File

@@ -0,0 +1,25 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.gaming.lutris;
in {
options = {
home.gaming.lutris.enable = mkEnableOption "Enables lutris";
};
config = mkIf cfg.enable {
home.packages = [
(pkgs.lutris.override {
extraPkgs = p: [
p.wineWowPackages.staging
p.pixman
p.libjpeg
p.gnome.zenity
];
})
];
};
}

View File

@@ -0,0 +1,20 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.gaming.mangohud;
in {
options = {
home.gaming.mangohud.enable = mkEnableOption "Enables mangohud";
};
config = mkIf cfg.enable {
programs.mangohud = {
enable = true;
settings = {
full = true;
};
};
};
}

View File

@@ -0,0 +1,64 @@
# Yanked from Misterio77
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkIf mkEnableOption concatStringsSep head filter getExe;
cfg = config.home.gaming.steam;
steam-with-pkgs = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
gamescope
];
};
monitor = head (filter (m: m.primary) config.monitors);
steam-session = let
gamescope = concatStringsSep " " [
(getExe pkgs.gamescope)
"--output-width ${toString monitor.width}"
"--output-height ${toString monitor.height}"
"--framerate-limit ${toString monitor.refreshRate}"
"--prefer-output ${monitor.name}"
# "--adaptive-sync"
"--expose-wayland"
"--hdr-enabled"
"--steam"
];
steam = concatStringsSep " " [
"steam"
"steam://open/bigpicture"
];
in
pkgs.writeTextDir "share/wayland-sessions/steam-sesson.desktop" # ini
''
[Desktop Entry]
Name=Steam Session
Exec=${gamescope} -- ${steam}
Type=Application
'';
in {
options = {
home.gaming.steam.enable = mkEnableOption "Enables steam";
};
config = {
home.packages = mkIf cfg.enable [
steam-with-pkgs
steam-session
pkgs.gamescope
];
};
}

View File

@@ -0,0 +1,87 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.alacritty;
in {
options = {
home.terminal.alacritty.enable = mkEnableOption "Enables firefox";
};
config = mkIf cfg.enable {
programs.alacritty = {
enable = true;
settings = {
# Default colors
colors.primary = {
background = "#282828";
foreground = "#d4be98";
};
colors = {
# Normal colors
normal = {
black = "#3c3836";
red = "#ea6962";
green = "#a9b665";
yellow = "#d8a657";
blue = "#7daea3";
magenta = "#d3869b";
cyan = "#89b482";
white = "#d4be98";
};
# Bright colors (same as normal colors)
bright = {
black = "#3c3836";
red = "#ea6962";
green = "#a9b665";
yellow = "#d8a657";
blue = "#7daea3";
magenta = "#d3869b";
cyan = "#89b482";
white = "#d4be98";
};
};
font = {
size = 12;
normal = {
family = "Input Mono Compressed";
style = "Light";
};
bold = {
family = "Input Mono Compressed";
style = "Regular";
};
italic = {
family = "Input Mono Compressed";
style = "Italic";
};
};
keyboard.bindings = [
{
action = "Copy";
key = "C";
mods = "Command";
}
{
action = "Paste";
key = "V";
mods = "Command";
}
];
window = {
dynamic_title = true;
opacity = 0.9;
padding = {
x = 5;
y = 5;
};
dimensions = {
columns = 120;
lines = 35;
};
};
};
};
};
}

View File

@@ -0,0 +1,247 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.foot;
in {
options = {
home.terminal.foot.enable = mkEnableOption "Enables foot terminal";
};
config = mkIf cfg.enable {
programs.foot = {
enable = true;
package = pkgs.foot;
settings = {
# -*- conf -*-
# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
# title=foot
# locked-title=no
# font=monospace:size=8
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# font-size-adjustment=0.5
# line-height=<font metrics>
# letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# underline-thickness=<font underline thickness>
# box-drawings-uses-font-glyphs=no
# dpi-aware=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
# pad=0x0 # optionally append 'center'
# resize-by-cells=yes
# resize-delay-ms=100
# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is libutempter (Linux)
# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ulog (FreeBSD)
main = {
font = "Input Mono Compressed:size=12";
box-drawings-uses-font-glyphs = "yes";
dpi-aware = "no";
pad = "3x1";
term = "xterm-256color";
};
environment = {
# name=value
};
bell = {
urgent = "no";
notify = "no";
visual = "no";
command = "no";
command-focused = "no";
};
scrollback = {
lines = "100";
# multiplier=3.0
# indicator-position=relative
# indicator-format=""
};
url = {
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
};
cursor = {
style = "block";
# color=<inverse foreground/background>
blink = "no";
# blink-rate=500
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
};
mouse = {
hide-when-typing = "no";
# alternate-scroll-mode=yes
};
touch = {
# long-press-delay=400
};
colors = {
alpha = "0.9";
background = "282828";
foreground = "ebdbb2";
regular0 = "282828";
regular1 = "cc241d";
regular2 = "98971a";
regular3 = "d79921";
regular4 = "458588";
regular5 = "b16286";
regular6 = "689d6a";
regular7 = "a89984";
bright0 = "928374";
bright1 = "fb4934";
bright2 = "b8bb26";
bright3 = "fabd2f";
bright4 = "83a598";
bright5 = "d3869b";
bright6 = "8ec07c";
bright7 = "ebdbb2";
};
csd = {
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-maximized=no
# double-click-to-maximize=yes
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
};
key-bindings = {
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard
# show-urls-launch=Control+Shift+o
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=Control+Shift+u
# noop=none
};
search-bindings = {
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-char=Shift+Right
# extend-to-word-boundary=Control+w Control+Shift+Right
# extend-to-next-whitespace=Control+Shift+w
# extend-line-down=Shift+Down
# extend-backward-char=Shift+Left
# extend-backward-to-word-boundary=Control+Shift+Left
# extend-backward-to-next-whitespace=none
# extend-line-up=Shift+Up
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
# quit=none
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
};
url-bindings = {
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
};
text-bindings = {
# \x03=Mod4+c # Map Super+c -> Ctrl+c
};
mouse-bindings = {
# scrollback-up-mouse=BTN_BACK
# scrollback-down-mouse=BTN_FORWARD
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-quote = BTN_LEFT-3
# select-row=BTN_LEFT-4
};
# vim: ft=dosini
};
};
};
}

View File

@@ -0,0 +1,106 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.kitty;
in {
options = {
home.terminal.kitty.enable = mkEnableOption "Enables kitty terminal";
};
config = mkIf cfg.enable {
programs.kitty = {
enable = true;
settings = {
# include = "theme.conf";
enable_audio_bell = false;
open_url_with = "firefox-nightly";
font_family = "Input Mono Compressed Extra Light";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
font_size = "11.0";
cursor_blink_interval = 0;
copy_on_select = "clipboard";
background_opacity = "0.95";
background_blur = "32";
window_padding_width = 3;
# tab_bar_min_tabs = 1;
# tab_bar_edge = "bottom";
tab_bar_style = "separator";
tab_bar_margin_width = "0.0";
tab_bar_margin_height = "0.0 0.0";
active_tab_font_style = "normal";
inactive_tab_font_style = "normal";
# tab_title_max_length = 30;
# # colors
# active_tab_foreground = "#32302f";
# active_tab_background = "#282828";
# inactive_tab_foreground = "#282828";
# inactive_tab_background = "#504945";
tab_bar_background = "#504945";
tab_bar_min_tabs = 1;
tab_bar_edge = "bottom";
# tab_powerline_style = "slanted";
};
extraConfig = ''
kitty_mod shift+ctrl
map kitty_mod+q close_tab
map ctrl+shift+c copy_to_clipboard
map ctrl+shift+v paste_from_clipboard
tab_separator ""
tab_title_template "{fmt.fg._504945}{fmt.bg.default}{fmt.fg._282828}{fmt.bg.default}{index}{fmt.fg._282828}{fmt.bg._504945} {title[:15] + (title[15:] and '')} {fmt.fg._504945}{fmt.bg.default} "
active_tab_title_template "{fmt.fg._282828}{fmt.bg.default}{fmt.fg._A89984}{fmt.bg._282828}{fmt.fg._A89984}{fmt.bg._282828} {title[:40] + (title[40:] and '')} {fmt.fg._282828}{fmt.bg.default} "
# vim:ft=kitty
## name: Gruvbox Material Dark Cnst
## author: Sainnhe Park
## license: MIT
## upstream: https://raw.githubusercontent.com/rsaihe/gruvbox-material-kitty/main/colors/gruvbox-material-dark-medium.conf
## blurb: A modified version of Gruvbox with softer contrasts
background #282828
foreground #d4be98
selection_background #d4be98
selection_foreground #282828
cursor #a89984
cursor_text_color background
# Black
color0 #665c54
color8 #928374
# Red
color1 #ea6962
color9 #ea6962
# Green
color2 #a9b665
color10 #a9b665
# Yellow
color3 #e78a4e
color11 #d8a657
# Blue
color4 #7daea3
color12 #7daea3
# Magenta
color5 #d3869b
color13 #d3869b
# Cyan
color6 #89b482
color14 #89b482
# White
color7 #d4be98
color15 #d4be98
'';
};
};
}

View File

@@ -0,0 +1,58 @@
{
pkgs,
config,
lib,
inputs,
...
}: let
enable_wayland = "true";
weztermPkg = pkgs.wezterm;
# weztermFlake = inputs.wezterm.packages.${pkgs.system}.default;
inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.wezterm;
in {
options = {
home.terminal.wezterm.enable = mkEnableOption "Enables wezterm terminal";
};
config = mkIf cfg.enable {
programs.wezterm = {
enable = true;
package = weztermPkg;
extraConfig =
/*
lua
*/
''
local wezterm = require 'wezterm';
local config = {
-- 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 = false,
enable_tab_bar = false,
use_fancy_tab_bar = false,
scrollback_lines = 10000,
window_background_opacity = 0.9,
}
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
config.default_prog = { "powershell.exe" }
else
config.enable_wayland = ${enable_wayland}
-- config.window_decorations = "TITLE"
config.window_close_confirmation = "NeverPrompt"
-- config.freetype_load_target = "Light"
-- config.freetype_render_target = "HorizontalLcd"
local f = wezterm.font_with_fallback({
{family="Input Mono Compressed", weight="Light"},
{family="Input Sans Narrow", weight="Light"},
})
config.font = f;
end
return config
'';
};
};
}

View File

@@ -0,0 +1,89 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.zellij;
in {
options = {
home.terminal.zellij.enable = mkEnableOption "Enables zellij";
};
config = mkIf cfg.enable {
programs.zellij = {
enable = true;
enableZshIntegration = false;
};
home.shellAliases = {
zr = "zellij run --";
zrf = "zellij run --floating --";
ze = "zellij edit";
zef = "zellij edit --floating";
};
xdg.configFile."zellij/config.kdl".text = ''
default_layout "compact"
mouse_mode true
copy_on_select true
copy_command "wl-copy"
simplified_ui false
scrollback_editor "/home/cnst/.nix-profile/bin/nvim"
pane_frames true
on_force_close "detach"
ui {
pane_frames {
rounded_corners false
}
}
keybinds {
normal {
bind "Alt m" {
LaunchPlugin "file:~/.config/zellij/plugins/monocle.wasm" {
in_place true
kiosk true
};
SwitchToMode "Normal"
}
bind "Ctrl f" {
LaunchOrFocusPlugin "file:~/.config/zellij/plugins/monocle.wasm" {
floating true
}
SwitchToMode "Normal"
}
bind "Alt 1" { GoToTab 1;}
bind "Alt 2" { GoToTab 2;}
bind "Alt 3" { GoToTab 3;}
bind "Alt 4" { GoToTab 4;}
}
shared_except "locked" {
bind "Ctrl y" {
LaunchOrFocusPlugin "file:~/.config/zellij/plugins/room.wasm" {
floating true
ignore_case true
}
}
}
unbind "Ctrl b" "Ctrl h" "Ctrl g" "Alt j"
}
themes {
gruvbox-dark {
bg "#282828"
fg "#D5C4A1"
black "#3C3836"
red "#CC241D"
green "#98971A"
yellow "#D79921"
blue "#458588"
magenta "#B16286"
cyan "#689D6A"
white "#FBF1C7"
orange "#D65D0E"
}
}
'';
};
}

View File

@@ -0,0 +1,17 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.userd.blueman-applet;
in {
options = {
home.userd.blueman-applet.enable = mkEnableOption "Enables blueman-applet";
};
config = mkIf cfg.enable {
services.blueman-applet = {
enable = true;
};
};
}

View File

@@ -0,0 +1,17 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.userd.copyq;
in {
options = {
home.userd.copyq.enable = mkEnableOption "Enables copyq";
};
config = mkIf cfg.enable {
services.copyq = {
enable = true;
};
};
}

View File

@@ -0,0 +1,24 @@
{
config,
lib,
...
}: let
inherit (lib) types mkOption;
cfg = config.home.userd.dconf;
in {
options = {
home.userd.dconf.settings.color-scheme = mkOption {
type = types.str;
default = "prefer-dark";
};
};
config = {
dconf = {
settings = {
"org/gnome/desktop/interface" = {
color-scheme = cfg.settings.color-scheme;
};
};
};
};
}

View File

@@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.userd.gpg;
in {
options = {
home.userd.gpg.enable = mkEnableOption "Enables gpg";
};
config = mkIf cfg.enable {
services.gpg-agent = {
enable = true;
enableSshSupport = true;
};
};
}

View File

@@ -0,0 +1,91 @@
{
pkgs,
config,
...
}: {
home = {
packages = [pkgs.glib]; # gsettings
pointerCursor = {
# package = pkgs.catppuccin-cursors.latteDark;
# name = "catppuccin-latte-dark-cursors";
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
size = 28;
gtk.enable = true;
x11.enable = true;
};
};
gtk = {
enable = true;
theme = {
package = pkgs.orchis-theme;
name = "Orchis-Grey-Dark-Compact";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
font = {
name = "Input Sans Narrow Light";
size = 10;
};
cursorTheme = {
# package = pkgs.catppuccin-cursors.latteDark;
# name = "catppuccin-latte-dark-cursors";
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
size = 28;
};
gtk2 = {
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
'';
};
gtk3.extraConfig = {
# Lets be easy on the eyes. This should be easy to make dependent on
# the "variant" of the theme, but I never use a light theme anyway.
gtk-application-prefer-dark-theme = true;
# Decorations
gtk-decoration-layout = "appmenu:none";
gtk-toolbar-style = "GTK_TOOLBAR_BOTH";
gtk-toolbar-icon-size = "GTK_ICON_SIZE_LARGE_TOOLBAR";
gtk-button-images = 1;
gtk-menu-images = 1;
# Silence bells and whistles, quite literally.
gtk-error-bell = 0;
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
# Fonts
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
};
gtk4.extraConfig = {
# Prefer dark theme.
gtk-application-prefer-dark-theme = true;
# Decorations.
gtk-decoration-layout = "appmenu:none";
# Sounds, again.
gtk-error-bell = 0;
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
# Fonts, you know the drill.
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
};
};
}

View File

@@ -0,0 +1,140 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) types mkOption mkIf;
cfg = config.home.userd.gtk;
in {
options = {
home.userd.gtk.enable = mkOption {
type = types.bool;
default = true;
description = "Enable GTK configuration.";
};
home.userd.gtk.theme = mkOption {
type = types.str;
default = "Orchis-Grey-Dark-Compact";
description = "GTK theme name.";
};
home.userd.gtk.themePackage = mkOption {
type = types.package;
default = pkgs.orchis-theme;
description = "GTK theme package.";
};
home.userd.gtk.iconTheme = mkOption {
type = types.str;
default = "Adwaita";
description = "GTK icon theme name.";
};
home.userd.gtk.iconThemePackage = mkOption {
type = types.package;
default = pkgs.adwaita-icon-theme;
description = "GTK icon theme package.";
};
home.userd.gtk.font = mkOption {
type = types.attrsOf types.anything;
default = {
name = "Input Sans Narrow Light";
size = 10;
};
description = "GTK font configuration.";
};
home.userd.gtk.cursorTheme = mkOption {
type = types.attrsOf types.anything;
default = {
name = "Adwaita";
size = 28;
package = pkgs.adwaita-icon-theme;
};
description = "Cursor theme configuration.";
};
};
config = mkIf cfg.enable {
home = {
packages = [pkgs.glib];
pointerCursor = {
package = cfg.cursorTheme.package;
name = cfg.cursorTheme.name;
size = cfg.cursorTheme.size;
gtk.enable = true;
x11.enable = true;
};
};
gtk = {
enable = true;
theme = {
package = cfg.themePackage;
name = cfg.theme;
};
iconTheme = {
package = cfg.iconThemePackage;
name = cfg.iconTheme;
};
font = {
name = cfg.font.name;
size = cfg.font.size;
};
cursorTheme = {
package = cfg.cursorTheme.package;
name = cfg.cursorTheme.name;
size = cfg.cursorTheme.size;
};
gtk2 = {
extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
'';
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
gtk-decoration-layout = "appmenu:none";
gtk-toolbar-style = "GTK_TOOLBAR_BOTH";
gtk-toolbar-icon-size = "GTK_ICON_SIZE_LARGE_TOOLBAR";
gtk-button-images = 1;
gtk-menu-images = 1;
gtk-error-bell = 0;
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = true;
gtk-decoration-layout = "appmenu:none";
gtk-error-bell = 0;
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
};
};
};
}

View File

@@ -0,0 +1,39 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.userd.mako;
in {
options = {
home.userd.mako.enable = mkEnableOption "Enables mako";
};
config = mkIf cfg.enable {
services.mako = {
enable = true;
iconPath = "$HOME/.nix-profile/share/icons/Gruvbox-Plus-Dark";
font = "FiraCode Nerd Font Medium 12";
padding = "20";
margin = "10";
anchor = "top-right";
width = 400;
height = 150;
borderSize = 2;
defaultTimeout = 12000;
backgroundColor = "#3c3836dd";
borderColor = "#689d6add";
textColor = "#d5c4a1dd";
layer = "overlay";
extraConfig = ''
max-history=50
max-visible=4
outer-margin=25
icon-location=right
max-icon-size=48
[mode=do-not-disturb]
invisible=1
'';
};
};
}

View File

@@ -0,0 +1,19 @@
{pkgs, ...}: {
systemd.user.services.polkit-gnome-authentication-agent-1 = {
Unit.Description = "polkit-gnome-authentication-agent-1";
Install = {
WantedBy = ["graphical-session.target"];
Wants = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
}

View File

@@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.userd.syncthing;
in {
options = {
home.userd.syncthing.enable = mkEnableOption "Enables syncthing";
};
config = mkIf cfg.enable {
services.syncthing = {
enable = true;
tray.enable = false;
};
};
}

View File

@@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.userd.udiskie;
in {
options = {
home.userd.udiskie.enable = mkEnableOption "Enables udiskie";
};
config = mkIf cfg.enable {
services.udiskie = {
enable = true;
tray = "always";
notify = false;
};
};
}

View File

@@ -0,0 +1,16 @@
{config, ...}: {
xdg = {
userDirs = {
enable = true;
createDirectories = true;
desktop = "${config.home.homeDirectory}/desktop";
documents = "${config.home.homeDirectory}/documents";
download = "${config.home.homeDirectory}/downloads";
music = "${config.home.homeDirectory}/media/music";
pictures = "${config.home.homeDirectory}/media/images";
publicShare = "${config.home.homeDirectory}/documents/share";
templates = "${config.home.homeDirectory}/documents/templates";
videos = "${config.home.homeDirectory}/media/videos";
};
};
}

View File

@@ -0,0 +1,23 @@
{
inputs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.anyrun;
in {
imports = [
inputs.anyrun.homeManagerModules.default
];
options = {
home.utils.anyrun.enable = mkEnableOption "Enables anyrun";
};
config = mkIf cfg.enable {
programs.anyrun = {
enable = true;
#extraCss = builtins.readFile (./. + "/style-dark.css");
};
};
}

View File

@@ -0,0 +1,24 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.eza;
in {
options = {
home.utils.eza.enable = mkEnableOption "Enables eza";
};
config = mkIf cfg.enable {
programs.eza = {
enable = true;
git = true;
enableZshIntegration = false;
extraOptions = [
"--group-directories-first"
"--header"
"--icons"
];
};
};
}

View File

@@ -0,0 +1,76 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.misc;
in {
options = {
home.utils.misc.enable = mkEnableOption "Enables miscellaneous utility apps";
};
config = mkIf cfg.enable {
programs = {
ssh = {
enable = true;
};
# image viewer
feh = {
enable = true;
};
# system information
fastfetch = {
enable = true;
};
# a monitor of resources
btop = {
enable = true;
settings = {
color_theme = "gruvbox_material_dark";
};
};
};
home.packages = with pkgs; [
# misc.gui
virt-manager
xfce.thunar
file-roller # archiver
gnome-calculator
keepassxc
networkmanagerapplet # tray icon for NetworkManager
nwg-look # GTK settings
pavucontrol # GUI sound control
qbittorrent
usbimager # write bootable usb images!
slurp # select region for screenshot
# misc.tui
ranger
xcur2png
calcurse # calendar
chatgpt-cli
exiftool
hyprpicker # Color picker
libnotify
pamixer # TUI sound control
ripgrep
file
fd
gnused
nix-tree
# misc.system
adwaita-icon-theme
qt5.qtwayland
qt6.qtwayland
wireguard-tools
wl-clipboard
wpa_supplicant
xfce.thunar-archive-plugin
xfce.thunar-volman
unzip
zip
gnutar
p7zip
];
};
}

View File

@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.mpv;
in {
options = {
home.utils.mpv.enable = mkEnableOption "Enables mpv";
};
config = mkIf cfg.enable {
programs.mpv = {
enable = true;
defaultProfiles = ["gpu-hq"];
scripts = [pkgs.mpvScripts.mpris];
};
};
}

View File

@@ -0,0 +1,21 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.rofi;
in {
options = {
home.utils.rofi.enable = mkEnableOption "Enables firefox";
};
config = mkIf cfg.enable {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland-unwrapped;
configPath = "home/cnst/.config/rofi/config.rasi";
font = "Rec Mono Linear 11";
};
};
}

View File

@@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.ssh;
in {
options = {
home.utils.ssh.enable = mkEnableOption "Enables ssh";
};
config = mkIf cfg.enable {
programs.ssh = {
enable = true;
userKnownHostsFile = "~/.ssh/known_hosts";
};
};
}

View File

@@ -0,0 +1,38 @@
{
inputs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.tuirun;
in {
imports = [
inputs.tuirun.homeManagerModules.default
];
options = {
home.utils.tuirun.enable = mkEnableOption "Enables tuirun";
};
config = mkIf cfg.enable {
programs.tuirun = {
enable = true;
config = {
plugins = with inputs.tuirun.packages.${pkgs.system}; [
runner
];
closeOnClick = true;
cursor = "Underscore";
};
extraConfigFiles = {
"runner.ron".text = ''
Config(
desktop_actions: false,
terminal: Some("foot"),
max_entries: 5,
)
'';
};
};
};
}

View File

@@ -0,0 +1,23 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.waybar;
in {
options = {
home.utils.waybar.enable = mkEnableOption "Enables waybar";
};
config = mkIf cfg.enable {
systemd.user.services.waybar = {
Unit.StartLimitBurst = 30;
};
programs.waybar = {
enable = true;
package = pkgs.waybar;
systemd.enable = true;
};
};
}

View File

@@ -0,0 +1,47 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.yazi;
in {
imports = [
./theme
];
options = {
home.utils.yazi.enable = mkEnableOption "Enables yazi";
};
config = mkIf cfg.enable {
programs.yazi = {
enable = true;
package = pkgs.yazi;
enableBashIntegration = config.programs.bash.enable;
enableZshIntegration = config.programs.zsh.enable;
settings = {
manager = {
layout = [1 4 3];
sort_by = "alphabetical";
sort_sensitive = true;
sort_reverse = false;
sort_dir_first = true;
linemode = "none";
show_hidden = false;
show_symlink = true;
};
preview = {
tab_size = 2;
max_width = 600;
max_height = 900;
cache_dir = config.xdg.cacheHome;
};
};
};
};
}

View File

@@ -0,0 +1,13 @@
{
imports = [
./filetype.nix
./help.nix
./icons.nix
./input.nix
./manager.nix
./select.nix
./status.nix
./tasks.nix
./which.nix
];
}

View File

@@ -0,0 +1,59 @@
{
programs.yazi.theme.filetype.rules = [
# Images
{
mime = "image/*";
fg = "#83a598";
}
# Videos
{
mime = "video/*";
fg = "#b8bb26";
}
{
mime = "audio/*";
fg = "#b8bb26";
}
# Archives
{
mime = "application/zip";
fg = "#fe8019";
}
{
mime = "application/gzip";
fg = "#fe8019";
}
{
mime = "application/x-tar";
fg = "#fe8019";
}
{
mime = "application/x-bzip";
fg = "#fe8019";
}
{
mime = "application/x-bzip2";
fg = "#fe8019";
}
{
mime = "application/x-7z-compressed";
fg = "#fe8019";
}
{
mime = "application/x-rar";
fg = "#fe8019";
}
# Fallback
{
name = "*";
fg = "#a89984";
}
{
name = "*/";
fg = "#83a598";
}
];
}

View File

@@ -0,0 +1,15 @@
{
programs.yazi.theme.help = {
on = {fg = "#fe8019";};
exec = {fg = "#83a598";};
desc = {fg = "#928374";};
hovered = {
bg = "#504945";
bold = true;
};
footer = {
fg = "#3c3836";
bg = "#a89984";
};
};
}

View File

@@ -0,0 +1,503 @@
{
programs.yazi.theme.icon.rules = [
# Home
{
name = ".config/";
text = "";
}
{
name = ".ssh/";
text = "󰢬";
}
{
name = "Desktop/";
text = "";
}
{
name = "Development/";
text = "";
}
{
name = "Documents/";
text = "";
}
{
name = "Downloads/";
text = "󰉍";
}
{
name = "Library/";
text = "";
}
{
name = "Movies/";
text = "";
}
{
name = "Music/";
text = "󱍙";
}
{
name = "Pictures/";
text = "󰉏";
}
{
name = "Videos/";
text = "";
}
{
name = "Public/";
text = "";
}
# Git
{
name = ".git/";
text = "";
}
{
name = ".gitignore";
text = "";
}
{
name = ".gitmodules";
text = "";
}
{
name = ".gitattributes";
text = "";
}
# Dotfiles
{
name = ".DS_Store";
text = "";
}
{
name = ".bashrc";
text = "";
}
{
name = ".bashprofile";
text = "";
}
{
name = ".zshrc";
text = "";
}
{
name = ".zshenv";
text = "";
}
{
name = ".zprofile";
text = "";
}
{
name = ".vimrc";
text = "";
}
# Text
{
name = "*.txt";
text = "";
}
{
name = "*.md";
text = "";
}
{
name = "*.rst";
text = "";
}
{
name = "COPYING";
text = "󰿃";
}
{
name = "LICENSE";
text = "󰿃";
}
# Archives
{
name = "*.zip";
text = "";
}
{
name = "*.tar";
text = "";
}
{
name = "*.gz";
text = "";
}
{
name = "*.7z";
text = "";
}
{
name = "*.bz2";
text = "";
}
{
name = "*.xz";
text = "";
}
# Documents
{
name = "*.csv";
text = "";
}
{
name = "*.doc";
text = "";
}
{
name = "*.doct";
text = "";
}
{
name = "*.docx";
text = "";
}
{
name = "*.dot";
text = "";
}
{
name = "*.ods";
text = "";
}
{
name = "*.ots";
text = "";
}
{
name = "*.pdf";
text = "";
}
{
name = "*.pom";
text = "";
}
{
name = "*.pot";
text = "";
}
{
name = "*.ppm";
text = "";
}
{
name = "*.pps";
text = "";
}
{
name = "*.ppt";
text = "";
}
{
name = "*.potx";
text = "";
}
{
name = "*.ppmx";
text = "";
}
{
name = "*.ppsx";
text = "";
}
{
name = "*.pptx";
text = "";
}
{
name = "*.xlc";
text = "";
}
{
name = "*.xlm";
text = "";
}
{
name = "*.xls";
text = "";
}
{
name = "*.xlt";
text = "";
}
{
name = "*.xlsm";
text = "";
}
{
name = "*.xlsx";
text = "";
}
# Audio
{
name = "*.mp3";
text = "";
}
{
name = "*.flac";
text = "";
}
{
name = "*.wav";
text = "";
}
{
name = "*.aac";
text = "";
}
{
name = "*.ogg";
text = "";
}
{
name = "*.m4a";
text = "";
}
{
name = "*.mp2";
text = "";
}
# Movies
{
name = "*.mp4";
text = "";
}
{
name = "*.mkv";
text = "";
}
{
name = "*.avi";
text = "";
}
{
name = "*.mov";
text = "";
}
{
name = "*.webm";
text = "";
}
# Images
{
name = "*.jpg";
text = "";
}
{
name = "*.jpeg";
text = "";
}
{
name = "*.png";
text = "";
}
{
name = "*.gif";
text = "";
}
{
name = "*.webp";
text = "";
}
{
name = "*.avif";
text = "";
}
{
name = "*.bmp";
text = "";
}
{
name = "*.ico";
text = "";
}
{
name = "*.svg";
text = "";
}
{
name = "*.xcf";
text = "";
}
{
name = "*.HEIC";
text = "";
}
# Programming
{
name = "*.c";
text = "";
}
{
name = "*.cpp";
text = "";
}
{
name = "*.h";
text = "";
}
{
name = "*.hpp";
text = "";
}
{
name = "*.rs";
text = "";
}
{
name = "*.go";
text = "";
}
{
name = "*.py";
text = "";
}
{
name = "*.hs";
text = "";
}
{
name = "*.js";
text = "";
}
{
name = "*.ts";
text = "";
}
{
name = "*.tsx";
text = "";
}
{
name = "*.jsx";
text = "";
}
{
name = "*.rb";
text = "";
}
{
name = "*.php";
text = "";
}
{
name = "*.java";
text = "";
}
{
name = "*.sh";
text = "";
}
{
name = "*.fish";
text = "";
}
{
name = "*.swift";
text = "";
}
{
name = "*.vim";
text = "";
}
{
name = "*.lua";
text = "";
}
{
name = "*.html";
text = "";
}
{
name = "*.css";
text = "";
}
{
name = "*.sass";
text = "";
}
{
name = "*.scss";
text = "";
}
{
name = "*.json";
text = "";
}
{
name = "*.toml";
text = "";
}
{
name = "*.yml";
text = "";
}
{
name = "*.yaml";
text = "";
}
{
name = "*.ini";
text = "";
}
{
name = "*.conf";
text = "";
}
{
name = "*.lock";
text = "";
}
{
name = "*.nix";
text = "";
}
{
name = "Containerfile";
text = "󰡨";
}
{
name = "Dockerfile";
text = "󰡨";
}
# Misc
{
name = "*.bin";
text = "";
}
{
name = "*.exe";
text = "";
}
{
name = "*.pkg";
text = "";
}
# Default
{
name = "*";
text = "";
}
{
name = "*/";
text = "";
}
];
}

View File

@@ -0,0 +1,8 @@
{
programs.yazi.theme.input = {
border = {fg = "#bdae93";};
title = {};
value = {};
selected = {reversed = true;};
};
}

View File

@@ -0,0 +1,59 @@
{
programs.yazi.theme.manager = {
cwd = {fg = "#83a598";};
# Hovered
hovered = {
fg = "#282828";
bg = "#83a598";
};
preview_hovered = {underline = true;};
# Find
find_keyword = {
fg = "#b8bb26";
italic = true;
};
find_position = {
fg = "#fe8019";
bg = "reset";
italic = true;
};
# Marker
marker_selected = {
fg = "#b8bb26";
bg = "#b8bb26";
};
marker_copied = {
fg = "#b8bb26";
bg = "#b8bb26";
};
marker_cut = {
fg = "#fb4934";
bg = "#fb4934";
};
# Tab
tab_active = {
fg = "#282828";
bg = "#504945";
};
tab_inactive = {
fg = "#a89984";
bg = "#3c3836";
};
tab_width = 1;
# Border;
border_symbol = "";
border_style = {fg = "#665c54";};
# Offset;
folder_offset = [1 0 1 0];
preview_offset = [1 1 1 1];
# Highlighting;
syntect_theme = "";
};
}

View File

@@ -0,0 +1,7 @@
{
programs.yazi.theme.select = {
border = {fg = "#504945";};
active = {fg = "#fe8019";};
inactive = {};
};
}

View File

@@ -0,0 +1,48 @@
{
programs.yazi.theme.status = {
separator_open = "";
separator_close = "";
separator_style = {
fg = "#3c3836";
bg = "#3c3836";
};
# Mode;
mode_normal = {
fg = "#282828";
bg = "#A89984";
bold = true;
};
mode_select = {
fg = "#282828";
bg = "#b8bb26";
bold = true;
};
mode_unset = {
fg = "#282828";
bg = "#d3869b";
bold = true;
};
# Progress;
progress_label = {
fg = "#ebdbb2";
bold = true;
};
progress_normal = {
fg = "#504945";
bg = "#3c3836";
};
progress_error = {
fg = "#fb4934";
bg = "#3c3836";
};
# Permissions;
permissions_t = {fg = "#504945";};
permissions_r = {fg = "#b8bb26";};
permissions_w = {fg = "#fb4934";};
permissions_x = {fg = "#b8bb26";};
permissions_s = {fg = "#665c54";};
};
}

View File

@@ -0,0 +1,7 @@
{
programs.yazi.theme.tasks = {
border = {fg = "#504945";};
title = {};
hovered = {underline = true;};
};
}

View File

@@ -0,0 +1,10 @@
{
programs.yazi.theme.which = {
mask = {bg = "#3c3836";};
cand = {fg = "#83a598";};
rest = {fg = "#928374";};
desc = {fg = "#fe8019";};
separator = " ";
separator_style = {fg = "#504945";};
};
}

View File

@@ -0,0 +1,61 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.utils.zathura;
in {
options = {
home.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";
};
};
}

Some files were not shown because too many files have changed in this diff Show More