beginning of big refactoring

This commit is contained in:
Charlie Root 2024-07-20 13:18:01 +02:00
commit 7d73d14ea5
68 changed files with 358 additions and 2818 deletions

View file

@ -5,9 +5,9 @@
inputs,
...
}: let
cfg = config.modules.editors.emacs;
cfg = config.modules.system.programs.editors.emacs;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
inherit (lib) mkIf;
newpkgs =
pkgs.appendOverlays
@ -152,10 +152,6 @@
ws-butler
]));
in {
options.modules.editors.emacs = {
enable = mkEnableOption "emacs";
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [

View file

@ -4,12 +4,11 @@
pkgs,
...
}: let
cfg = config.modules.editors.helix;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
options.modules.editors.helix.enable = lib.mkEnableOption "helix";
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix = {
enable = true;

View file

@ -3,13 +3,11 @@
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.editors.kakoune;
}: let
cfg = config.modules.system.programs.editors;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
options.modules.editors.kakoune.enable = mkEnableOption "kakoune";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.kakoune = {

View file

@ -1,18 +0,0 @@
_: {
base01 = "#2c2e3e";
base00 = "#20202A";
base02 = "#3D4059";
base03 = "#313449";
base04 = "#63718b";
base05 = "#ced4df";
base06 = "#414560";
base07 = "#63718b";
base08 = "#ebb9b9";
base09 = "#e8cca7";
base0A = "#e6dfb8";
base0B = "#b1dba4";
base0C = "#b8dceb";
base0D = "#a3b8ef";
base0E = "#f6bbe7";
base0F = "#eAc1c1";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#171B20";
base01 = "#21262e";
base02 = "#2b323b";
base03 = "#3c4453";
base04 = "#485263";
base05 = "#b6beca";
base06 = "#dee1e6";
base07 = "#dee1e6";
base08 = "#70A5EB";
base09 = "#e9a180";
base0A = "#f1cf8a";
base0B = "#78DBA9";
base0C = "#e26c7c";
base0D = "#86aaec";
base0E = "#c68aee";
base0F = "#9cd1ff";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#101618";
base01 = "#232a2d";
base02 = "#2d3437";
base03 = "#404749";
base04 = "#4f5658";
base05 = "#cacaca";
base06 = "#d2d2d2";
base07 = "#dadada";
base08 = "#e57474";
base09 = "#e19d5c";
base0A = "#e5c76b";
base0B = "#8ccf7e";
base0C = "#71baf2";
base0D = "#67cbe7";
base0E = "#c47fd5";
base0F = "#ef7d7d";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#2b3339";
base01 = "#323c41";
base02 = "#3a4248";
base03 = "#868d80";
base04 = "#d3c6aa";
base05 = "#d3c6aa";
base06 = "#e9e8d2";
base07 = "#fff9e8";
base08 = "#7fbbb3";
base09 = "#d699b6";
base0A = "#83c092";
base0B = "#dbbc7f";
base0C = "#e69875";
base0D = "#a7c080";
base0E = "#e67e80";
base0F = "#d699b6";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#1e2122";
base01 = "#2c2f30";
base02 = "#36393a";
base03 = "#404344";
base04 = "#d4be98";
base05 = "#c0b196";
base06 = "#c3b499";
base07 = "#c7b89d";
base08 = "#ec6b64";
base09 = "#e78a4e";
base0A = "#e0c080";
base0B = "#a9b665";
base0C = "#86b17f";
base0D = "#7daea3";
base0E = "#d3869b";
base0F = "#d65d0e";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#151515";
base01 = "#1c1c1c";
base02 = "#404040";
base03 = "#888888";
base04 = "#ddddbf";
base05 = "#e8e8d3";
base06 = "#eeeede";
base07 = "#f1f1e5";
base08 = "#cf6a4c";
base09 = "#d8ad4c";
base0A = "#d8ad4c";
base0B = "#99ad6a";
base0C = "#71b9f8";
base0D = "#597bc5";
base0E = "#c6b6ee";
base0F = "#d8ad4c";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#0f0f0f";
base01 = "#151515";
base02 = "#191919";
base03 = "#323232";
base04 = "#535353";
base05 = "#f0f0f0";
base06 = "#d8d8d8";
base07 = "#414141";
base08 = "#ac8a8c";
base09 = "#d3d0ad";
base0A = "#ACA98A";
base0B = "#8aac8b";
base0C = "#9EC3C4";
base0D = "#8fb4b5";
base0E = "#C49EC4";
base0F = "#9d9a7b";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#151515";
base01 = "#1F1F1F";
base02 = "#2E2E2E";
base03 = "#424242";
base04 = "#BBB6B6";
base05 = "#E8E3E3";
base06 = "#E8E3E3";
base07 = "#E8E3E3";
base08 = "#B66467";
base09 = "#D9BC8C";
base0A = "#D9BC8C";
base0B = "#8C977D";
base0C = "#8AA6A2";
base0D = "#8DA3B9";
base0E = "#A988B0";
base0F = "#BBB6B6";
}

View file

@ -1,18 +0,0 @@
_: {
base00 = "#1A1B26";
base01 = "#3b4261";
base02 = "#3b4261";
base03 = "#545c7e";
base04 = "#565c64";
base05 = "#a9b1d6";
base06 = "#bbc5f0";
base07 = "#c0caf5";
base08 = "#f7768e";
base09 = "#ff9e64";
base0A = "#e0af68";
base0B = "#9ece6a";
base0C = "#2ac3de";
base0D = "#7aa2f7";
base0E = "#9d7cd8";
base0F = "#9abdf5";
}

View file

@ -1,28 +0,0 @@
{
config,
lib,
inputs,
...
}: let
inherit (builtins) filter map toString elem;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
inherit (lib.lists) concatLists;
mkNixvimModule = {
path,
ignoredPaths ? [
],
}:
filter (hasSuffix ".nix") (
map toString (
filter (path: path != ./default.nix && !elem path ignoredPaths) (listFilesRecursive path)
)
);
in {
imports = concatLists [
[inputs.nixvim.nixosModules.nixvim]
(mkNixvimModule {path = ./.;})
];
}

View file

@ -1,121 +0,0 @@
{
config,
lib,
...
}: let
colors = import ./colors/${config.theme}.nix {};
in {
config = lib.mkIf config.colorschemes.base16.enable {
highlight = {
CursorLine = {
fg = "none";
bg = "none";
};
CursorLineNr = {
fg = "none";
bg = "none";
};
AlphaHeader = {
fg = colors.base0E;
bg = "none";
};
StatusNormal = {
bg = "none";
fg = "none";
};
TelescopePromptBorder = {
fg = colors.base01;
bg = colors.base01;
};
TelescopePromptNormal = {
fg = "none";
bg = colors.base01;
};
TelescopePromptPrefix = {
fg = colors.base08;
bg = colors.base01;
};
TelescopeSelection = {
fg = "none";
bg = colors.base01;
};
Pmenu = {
fg = "none";
bg = colors.base01;
};
PmenuSbar = {
fg = "none";
bg = colors.base01;
};
PmenuThumb = {
fg = "none";
bg = colors.base01;
};
PmenuSel = {
fg = "none";
bg = colors.base02;
};
CmpItemAbbrMatch = {
fg = colors.base05;
bg = "none";
};
CmpItemAbbrMatchFuzzy = {
fg = colors.base05;
bg = "none";
};
CmpItemAbbr = {
fg = colors.base03;
bg = "none";
};
CmpItemKind = {
fg = colors.base0E;
bg = "none";
};
CmpItemMenu = {
fg = colors.base0E;
bg = "none";
};
CmpItemKindSnippet = {
fg = colors.base0E;
bg = "none";
};
VertSplit = {
fg = colors.base01;
bg = "none";
};
FloatBorder = {
fg = colors.base01;
bg = colors.base01;
};
NormalFloat = {
fg = "none";
bg = colors.base01;
};
LineNr = {
fg = colors.base03;
bg = "none";
};
NoiceCmdlinePopup = {
fg = colors.base04;
bg = colors.base01;
};
NoiceCmdlinePopupBorder = {
fg = colors.base01;
bg = colors.base01;
};
NoiceCmdlinePopupBorderSearch = {
fg = colors.base01;
bg = colors.base01;
};
};
};
}

View file

@ -1,410 +0,0 @@
{
programs.nixvim = {
globals.mapleader = " ";
keymaps = [
{
mode = "n";
key = "<leader>f";
action = "+find/file";
options.desc = "Find a file";
}
{
mode = "n";
key = "<leader>s";
action = "+search";
options.desc = "Search in your file";
}
{
mode = "n";
key = "<leader>q";
action = "+quit/session";
options.desc = "Quit the current session";
}
{
mode = ["n" "v"];
key = "<leader>g";
action = "+git";
}
{
mode = "n";
key = "<leader>u";
action = "+ui";
}
{
mode = "n";
key = "<leader>w";
action = "+windows";
}
{
mode = "n";
key = "<leader><Tab>";
action = "+tab";
}
{
mode = ["n" "v"];
key = "<leader>d";
action = "+debug";
}
{
mode = ["n" "v"];
key = "<leader>c";
action = "+code";
}
{
mode = ["n" "v"];
key = "<leader>t";
action = "+test";
}
# Tabs
{
mode = "n";
key = "<leader><tab><tab>";
action = "<cmd>tabnew<cr>";
options = {
silent = true;
desc = "New Tab";
};
}
{
mode = "n";
key = "<leader><tab>d";
action = "<cmd>tabclose<cr>";
options = {
silent = true;
desc = "Close tab";
};
}
# Windows
{
mode = "n";
key = "<leader>ww";
action = "<C-W>p";
options = {
silent = true;
desc = "Other window";
};
}
{
mode = "n";
key = "<leader>wd";
action = "<C-W>c";
options = {
silent = true;
desc = "Delete window";
};
}
{
mode = "n";
key = "<leader>w-";
action = "<C-W>s";
options = {
silent = true;
desc = "Split window below";
};
}
{
mode = "n";
key = "<leader>w|";
action = "<C-W>v";
options = {
silent = true;
desc = "Split window right";
};
}
{
mode = "n";
key = "<C-h>";
action = "<C-W>h";
options = {
silent = true;
desc = "Move to window left";
};
}
{
mode = "n";
key = "<C-l>";
action = "<C-W>l";
options = {
silent = true;
desc = "Move to window right";
};
}
{
mode = "n";
key = "<C-k>";
action = "<C-W>k";
options = {
silent = true;
desc = "Move to window over";
};
}
{
mode = "n";
key = "<C-j>";
action = "<C-W>j";
options = {
silent = true;
desc = "Move to window bellow";
};
}
{
mode = "n";
key = "<C-s>";
action = "<cmd>w<cr><esc>";
options = {
silent = true;
desc = "Save file";
};
}
# Quit/Session
{
mode = "n";
key = "<leader>qq";
action = "<cmd>quitall<cr><esc>";
options = {
silent = true;
desc = "Quit all";
};
}
{
mode = "n";
key = "<leader>ul";
action = ":lua ToggleLineNumber()<cr>";
options = {
silent = true;
desc = "Toggle Line Numbers";
};
}
{
mode = "n";
key = "<leader>uL";
action = ":lua ToggleRelativeLineNumber()<cr>";
options = {
silent = true;
desc = "Toggle Relative Line Numbers";
};
}
{
mode = "n";
key = "<leader>uw";
action = ":lua ToggleWrap()<cr>";
options = {
silent = true;
desc = "Toggle Line Wrap";
};
}
{
mode = "v";
key = "J";
action = ":m '>+1<CR>gv=gv";
options = {desc = "Use move command when line is highlighted ";};
}
{
mode = "v";
key = "K";
action = ":m '>-2<CR>gv=gv";
options = {desc = "Use move command when line is highlighted ";};
}
{
mode = "n";
key = "J";
action = "mzJ`z";
options = {
desc = "Allow cursor to stay in the same place after appending to current line ";
};
}
{
mode = "n";
key = "<C-d>";
action = "<C-d>";
#action = "<C-d>zz";
options = {
desc = "Allow C-d and C-u to keep the cursor in the middle";
};
}
{
mode = "n";
key = "<C-u>";
#action = "<C-u>zz";
action = "<C-u>";
options = {
desc = "Allow C-d and C-u to keep the cursor in the middle";
};
}
{
mode = "n";
key = "n";
action = "nzzzv";
options = {desc = "Allow search terms to stay in the middle ";};
}
{
mode = "n";
key = "N";
action = "Nzzzv";
options = {desc = "Allow search terms to stay in the middle ";};
}
# Paste stuff without saving the deleted word into the buffer
{
mode = "x";
key = "<leader>p";
action = ''"_dP'';
options = {desc = "Deletes to void register and paste over";};
}
# Copy stuff to system clipboard with <leader> + y or just y to have it just in vim
{
mode = ["n" "v"];
key = "<leader>y";
action = ''"+y'';
options = {desc = "Copy to system clipboard";};
}
{
mode = ["n" "v"];
key = "<leader>Y";
action = ''"+Y'';
options = {desc = "Copy to system clipboard";};
}
# Delete to void register
{
mode = ["n" "v"];
key = "<leader>D";
action = ''"_d'';
options = {desc = "Delete to void register";};
}
# <C-c> instead of pressing esc just because
{
mode = "i";
key = "<C-c>";
action = "<Esc>";
}
{
mode = "n";
key = "<leader>zz";
action = "<CMD> ZenMode | Pencil<CR>";
options = {desc = "Toggle writting mode";};
}
{
mode = "n";
key = "<leader>m";
action = "<CMD> Grapple toggle <CR>";
options = {desc = "Grapple Toggle tag";};
}
{
mode = "n";
key = "<leader>k";
action = "<CMD> Grapple toggle_tags <CR>";
options = {desc = "Grapple Toggle tag";};
}
{
mode = "n";
key = "<leader>K";
action = "<CMD> Grapple toggle_scopes <CR>";
options = {desc = "Grapple Toggle scopes";};
}
{
mode = "n";
key = "<leader>j";
action = "<CMD> Grapple cycle forward <CR>";
options = {desc = "Grapple Cycle forward";};
}
{
mode = "n";
key = "<leader>J";
action = "<CMD> Grapple cycle backward <CR>";
options = {desc = "Grapple Cycle backward";};
}
{
mode = "n";
key = "<leader>1";
action = "<CMD> Grapple select index=1<CR>";
options = {desc = "Grapple Select 1";};
}
{
mode = "n";
key = "<leader>2";
action = "<CMD> Grapple select index=2<CR>";
options = {desc = "Grapple Select 2";};
}
{
mode = "n";
key = "<leader>3";
action = "<CMD> Grapple select index=3<CR>";
options = {desc = "Grapple Select 3";};
}
{
mode = "n";
key = "<leader>4";
action = "<CMD> Grapple select index=4<CR>";
options = {desc = "Grapple Select 4";};
}
];
extraConfigLua = ''
function ToggleLineNumber()
if vim.wo.number then
vim.wo.number = false
else
vim.wo.number = true
vim.wo.relativenumber = false
end
end
function ToggleRelativeLineNumber()
if vim.wo.relativenumber then
vim.wo.relativenumber = false
else
vim.wo.relativenumber = true
vim.wo.number = false
end
end
function ToggleWrap()
vim.wo.wrap = not vim.wo.wrap
end
'';
};
}

View file

@ -1,73 +0,0 @@
{
config,
lib,
inputs,
...
}: let
cfg = config.modules.editors.nixvim;
in {
options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim";
imports = [
inputs.nixvim.nixosModules.nixvim
./keys.nix
./settings.nix
./plug/completion/cmp.nix
#./plug/completion/copilot-cmp.nix
#./plug/completion/lspkind.nix
./plug/git/gitlinker.nix
./plug/git/gitsigns.nix
./plug/git/lazygit.nix
./plug/git/worktree.nix
./plug/lsp/conform.nix
./plug/lsp/fidget.nix
./plug/lsp/hlchunk.nix
./plug/lsp/lsp.nix
./plug/lsp/lspsaga.nix
./plug/lsp/none-ls.nix
./plug/lsp/trouble.nix
./plug/snippets/luasnip.nix
./plug/statusline/lualine.nix
#./plug/statusline/staline.nix
#./plug/treesitter/treesitter-context.nix
./plug/treesitter/treesitter-textobjects.nix
./plug/treesitter/treesitter.nix
./plug/ui/alpha.nix
./plug/ui/btw.nix
./plug/ui/bufferline.nix
./plug/ui/noice.nix
./plug/ui/nvim-notify.nix
./plug/ui/telescope.nix
./plug/utils/comment.nix
#./plug/utils/copilot.nix
./plug/utils/flash.nix
./plug/utils/hardtime.nix
#./plug/utils/harpoon.nix
./plug/utils/grapple.nix
./plug/utils/illuminate.nix
./plug/utils/nvim-autopairs.nix
./plug/utils/oil.nix
./plug/utils/undotree.nix
./plug/utils/ufo.nix
./plug/utils/whichkey.nix
./plug/utils/lazy.nix
];
options = {
theme = lib.mkOption {
default = "gruvbox";
type = lib.types.enum ["paradise" "decay" "mountain" "tokyonight" "everforest" "everblush" "jellybeans" "aquarium" "gruvbox"];
};
};
config = lib.mkIf cfg.enable {
programs.nixvim.enable = true;
# theme = "gruvbox";
# programs.nixvim.extraConfigLua = ''
# _G.theme = "${config.theme}"
#'';
};
}

View file

@ -1,122 +0,0 @@
{
programs.nixvim = {
plugins = {
cmp-emoji = {enable = true;};
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = {ghost_text = true;};
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = {expand = "luasnip";};
formatting = {fields = ["kind" "abbr" "menu"];};
sources = [
{name = "nvim_lsp";}
{name = "emoji";}
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
window = {
completion = {border = "solid";};
documentation = {border = "solid";};
};
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};
};
};
cmp-nvim-lsp = {enable = true;}; # lsp
cmp-buffer = {enable = true;};
cmp-path = {enable = true;}; # file system paths
cmp_luasnip = {enable = true;}; # snippets
cmp-cmdline = {enable = false;}; # autocomplete for cmdline
};
extraConfigLua = ''
luasnip = require("luasnip")
kind_icons = {
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 = "",
}
local cmp = require'cmp'
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({'/', "?" }, {
sources = {
{ name = 'buffer' }
}
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
-- formatting = {
-- format = function(_, vim_item)
-- vim_item.kind = cmdIcons[vim_item.kind] or "FOO"
-- return vim_item
-- end
-- }
}) '';
};
}

View file

@ -1,8 +0,0 @@
{
programs.nixvim.plugins.gitlinker = {
enable = true;
callbacks = {
"gihub.com" = "get_github_type_url";
};
};
}

View file

@ -1,78 +0,0 @@
{
programs.nixvim = {
plugins.gitsigns = {
enable = true;
settings = {
trouble = true;
current_line_blame = true;
signs = {
add = {
text = "";
};
change = {
text = "";
};
delete = {
text = "_";
};
topdelete = {
text = "";
};
changedelete = {
text = "~";
};
untracked = {
text = "";
};
};
};
};
keymaps = [
{
mode = ["n" "v"];
key = "<leader>gh";
action = "gitsigns";
options = {
silent = true;
desc = "+hunks";
};
}
{
mode = "n";
key = "<leader>ghb";
action = ":Gitsigns blame_line<CR>";
options = {
silent = true;
desc = "Blame line";
};
}
{
mode = "n";
key = "<leader>ghd";
action = ":Gitsigns diffthis<CR>";
options = {
silent = true;
desc = "Diff This";
};
}
{
mode = "n";
key = "<leader>ghR";
action = ":Gitsigns reset_buffer<CR>";
options = {
silent = true;
desc = "Reset Buffer";
};
}
{
mode = "n";
key = "<leader>ghS";
action = ":Gitsigns stage_buffer<CR>";
options = {
silent = true;
desc = "Stage Buffer";
};
}
];
};
}

View file

@ -1,22 +0,0 @@
{pkgs, ...}: {
programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [
lazygit-nvim
];
extraConfigLua = ''
require("telescope").load_extension("lazygit")
'';
keymaps = [
{
mode = "n";
key = "<leader>gg";
action = "<cmd>LazyGit<CR>";
options = {
desc = "LazyGit (root dir)";
};
}
];
};
}

View file

@ -1,6 +0,0 @@
{
programs.nixvim.plugins.git-worktree = {
enable = true;
enableTelescope = true;
};
}

View file

@ -1,24 +0,0 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
liquidsoap = ["liquidsoap-prettier"];
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 = ["yamllint" "yamlfmt"];
};
};
}

View file

@ -1,101 +0,0 @@
{
programs.nixvim = {
plugins.fidget = {
enable = true;
logger = {
level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
floatPrecision = 0.01; # Limit the number of decimals displayed for floats
};
progress = {
pollRate = 0; # How and when to poll for progress messages
suppressOnInsert = true; # Suppress new messages while in insert mode
ignoreDoneAlready = false; # Ignore new tasks that are already complete
ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message
clearOnDetach =
# Clear notification group when LSP server detaches
''
function(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return client and client.name or nil
end
'';
notificationGroup =
# How to get a progress message's notification group key
''
function(msg) return msg.lsp_client.name end
'';
ignore = []; # List of LSP servers to ignore
lsp = {
progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size
};
display = {
renderLimit = 16; # How many LSP messages to show at once
doneTtl = 3; # How long a message should persist after completion
doneIcon = ""; # Icon shown when all LSP progress tasks are complete
doneStyle = "Constant"; # Highlight group for completed LSP tasks
progressTtl = "math.huge"; # How long a message should persist when in progress
progressIcon = {
pattern = "dots";
period = 1;
}; # Icon shown when LSP progress tasks are in progress
progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks
groupStyle = "Title"; # Highlight group for group name (LSP server name)
iconStyle = "Question"; # Highlight group for group icons
priority = 30; # Ordering priority for LSP notification group
skipHistory = true; # Whether progress notifications should be omitted from history
formatMessage = ''
require ("fidget.progress.display").default_format_message
''; # How to format a progress message
formatAnnote = ''
function (msg) return msg.title end
''; # How to format a progress annotation
formatGroupName = ''
function (group) return tostring (group) end
''; # How to format a progress notification group's name
overrides = {
rust_analyzer = {
name = "rust-analyzer";
};
}; # Override options from the default notification config
};
};
notification = {
pollRate = 10; # How frequently to update and render notifications
filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
historySize = 128; # Number of removed messages to retain in history
overrideVimNotify = true;
redirect = ''
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end
'';
configs = {
default = "require('fidget.notification').default_config";
};
window = {
normalHl = "Comment";
winblend = 0;
border = "none"; # none, single, double, rounded, solid, shadow
zindex = 45;
maxWidth = 0;
maxHeight = 0;
xPadding = 1;
yPadding = 0;
align = "bottom";
relative = "editor";
};
view = {
stackUpwards = true; # Display notification items from bottom to top
iconSeparator = " "; # Separator between group name and icon
groupSeparator = "---"; # Separator between notification groups
groupSeparatorHl =
# Highlight group used for group separator
"Comment";
};
};
};
};
}

View file

@ -1,13 +0,0 @@
{pkgs, ...}: {
programs.nixvim.extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
name = "hlchunk";
src = pkgs.fetchFromGitHub {
owner = "shellRaining";
repo = "hlchunk.nvim";
rev = "882d1bc86d459fa8884398223c841fd09ea61b6b";
hash = "sha256-fvFvV7KAOo7xtOCjhGS5bDUzwd10DndAKs3++dunED8=";
};
})
];
}

View file

@ -1,98 +0,0 @@
{
programs.nixvim = {
plugins = {
lsp-format = {enable = true;};
lsp = {
enable = true;
servers = {
eslint = {enable = true;};
html = {enable = true;};
lua-ls = {enable = true;};
nil_ls = {enable = true;};
marksman = {enable = true;};
pyright = {enable = true;};
gopls = {enable = true;};
terraformls = {enable = true;};
tsserver = {enable = false;};
yamlls.enable = true;
typst-lsp.enable = true;
texlab.enable = true;
};
keymaps = {
silent = true;
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
K = {
action = "hover";
desc = "Hover";
};
"<leader>cw" = {
action = "workspace_symbol";
desc = "Workspace Symbol";
};
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
diagnostic = {
"<leader>cd" = {
action = "open_float";
desc = "Line Diagnostics";
};
"[d" = {
action = "goto_next";
desc = "Next Diagnostic";
};
"]d" = {
action = "goto_prev";
desc = "Previous Diagnostic";
};
};
};
};
};
extraConfigLua = ''
local _border = "rounded"
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
vim.lsp.handlers.hover, {
border = _border
}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help, {
border = _border
}
)
vim.diagnostic.config{
float={border=_border}
};
require('lspconfig.ui.windows').default_options = {
border = _border
}
'';
};
}

View file

@ -1,188 +0,0 @@
{
programs.nixvim = {
plugins.lspsaga = {
enable = true;
beacon = {
enable = true;
};
ui = {
border = "rounded"; # One of none, single, double, rounded, solid, shadow
codeAction = "💡"; # Can be any symbol you want 💡
};
hover = {
openCmd = "!floorp"; # Choose your browser
openLink = "gx";
};
diagnostic = {
borderFollow = true;
diagnosticOnlyCurrent = false;
showCodeAction = true;
};
symbolInWinbar = {
enable = true; # Breadcrumbs
};
codeAction = {
extendGitSigns = false;
showServerName = true;
onlyInCursor = true;
numShortcut = true;
keys = {
exec = "<CR>";
quit = ["<Esc>" "q"];
};
};
lightbulb = {
enable = false;
sign = false;
virtualText = true;
};
implement = {
enable = false;
};
rename = {
autoSave = false;
keys = {
exec = "<CR>";
quit = ["<C-k>" "<Esc>"];
select = "x";
};
};
outline = {
autoClose = true;
autoPreview = true;
closeAfterJump = true;
layout = "normal"; # normal or float
winPosition = "right"; # left or right
keys = {
jump = "e";
quit = "q";
toggleOrJump = "o";
};
};
scrollPreview = {
scrollDown = "<C-f>";
scrollUp = "<C-b>";
};
};
keymaps = [
{
mode = "n";
key = "gd";
action = "<cmd>Lspsaga finder def<CR>";
options = {
desc = "Goto Definition";
silent = true;
};
}
{
mode = "n";
key = "gr";
action = "<cmd>Lspsaga finder ref<CR>";
options = {
desc = "Goto References";
silent = true;
};
}
# {
# mode = "n";
# key = "gD";
# action = "<cmd>Lspsaga show_line_diagnostics<CR>";
# options = {
# desc = "Goto Declaration";
# silent = true;
# };
# }
{
mode = "n";
key = "gI";
action = "<cmd>Lspsaga finder imp<CR>";
options = {
desc = "Goto Implementation";
silent = true;
};
}
{
mode = "n";
key = "gT";
action = "<cmd>Lspsaga peek_type_definition<CR>";
options = {
desc = "Type Definition";
silent = true;
};
}
{
mode = "n";
key = "K";
action = "<cmd>Lspsaga hover_doc<CR>";
options = {
desc = "Hover";
silent = true;
};
}
{
mode = "n";
key = "<leader>cw";
action = "<cmd>Lspsaga outline<CR>";
options = {
desc = "Outline";
silent = true;
};
}
{
mode = "n";
key = "<leader>cr";
action = "<cmd>Lspsaga rename<CR>";
options = {
desc = "Rename";
silent = true;
};
}
{
mode = "n";
key = "<leader>ca";
action = "<cmd>Lspsaga code_action<CR>";
options = {
desc = "Code Action";
silent = true;
};
}
{
mode = "n";
key = "<leader>cd";
action = "<cmd>Lspsaga show_line_diagnostics<CR>";
options = {
desc = "Line Diagnostics";
silent = true;
};
}
{
mode = "n";
key = "[d";
action = "<cmd>Lspsaga diagnostic_jump_next<CR>";
options = {
desc = "Next Diagnostic";
silent = true;
};
}
{
mode = "n";
key = "]d";
action = "<cmd>Lspsaga diagnostic_jump_prev<CR>";
options = {
desc = "Previous Diagnostic";
silent = true;
};
}
];
};
}

View file

@ -1,52 +0,0 @@
{
programs.nixvim = {
plugins.none-ls = {
enable = true;
enableLspFormat = true;
updateInInsert = false;
sources = {
code_actions = {
gitsigns.enable = true;
statix.enable = true;
};
diagnostics = {
statix.enable = true;
yamllint.enable = true;
};
formatting = {
alejandra.enable = true;
black = {
enable = true;
withArgs = ''
{
extra_args = { "--fast" },
}
'';
};
prettier = {
enable = true;
disableTsServerFormatter = true;
withArgs = ''
{
extra_args = { "--no-semi", "--single-quote" },
}
'';
};
stylua.enable = true;
yamlfmt.enable = true;
};
};
};
keymaps = [
{
mode = ["n" "v"];
key = "<leader>cf";
action = "<cmd>lua vim.lsp.buf.format()<cr>";
options = {
silent = true;
desc = "Format";
};
}
];
};
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.trouble = {
enable = true;
};
}

View file

@ -1,15 +0,0 @@
{pkgs, ...}: {
programs.nixvim.plugins.luasnip = {
enable = true;
extraConfig = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
fromVscode = [
{
lazyLoad = true;
paths = "${pkgs.vimPlugins.friendly-snippets}";
}
];
};
}

View file

@ -1,103 +0,0 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
globalstatus = true;
disabledFiletypes = {
statusline = ["dashboard" "alpha" "starter"];
};
# theme = {
# normal = {
# a = {
# bg = "#b4befe";
# fg = "#1c1d21";
# };
# b = {
# bg = "nil";
# };
# c = {
# bg = "nil";
# };
# z = {
# bg = "nil";
# };
# y = {
# bg = "nil";
# };
# };
# };
sections = {
lualine_a = [
{
name = "mode";
fmt = "string.lower";
color = {
fg = "none";
bg = "none";
};
}
];
lualine_b = [
{
name = "branch";
icon = "";
color = {
fg = "none";
bg = "none";
};
}
"diff"
];
lualine_c = [
{
name = "diagnostic";
extraConfig = {
symbols = {
error = " ";
warn = " ";
info = " ";
hint = "󰝶 ";
};
};
color = {
fg = "none";
bg = "none";
};
}
];
lualine_x = [
{
name = "filetype";
extraConfig = {
icon_only = true;
};
}
];
lualine_y = [
{
name = "filename";
extraConfig = {
symbols = {
modified = "";
readonly = "";
unnamed = "";
};
};
color = {
fg = "none";
bg = "none";
};
separator.left = "";
}
];
lualine_z = [
{
name = "location";
color = {
fg = "none";
bg = "none";
};
}
];
};
};
}

View file

@ -1,65 +0,0 @@
{pkgs, ...}: {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "staline.nvim";
version = "2024-02-05";
src = pkgs.fetchFromGitHub {
owner = "tamton-aquib";
repo = "staline.nvim";
rev = "a53f869278b8b186a5afd6f21680cd103c381599";
hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws=";
};
})
];
extraConfigLua = ''
require("staline").setup({
sections = {
left = { "-mode", " ", "branch" },
mid = { "lsp_name" },
right = { "file_name", "line_column" },
},
inactive_sections = {
left = { "-mode", " ", "branch" },
mid = { "lsp_name" },
right = { "file_name", "line_column" },
},
defaults = {
left_separator = " ",
right_separator = " ",
branch_symbol = " ",
mod_symbol = "",
line_column = "[%l/%L]",
inactive_color = "#80a6f2", --#303030 is the default
inactive_bgcolor = "none",
},
special_table = {
lazy = { "Plugins", "💤 " },
TelescopePrompt = { "Telescope", " " },
oil = { "Oil", "󰏇 " },
lazygit = { "LazyGit", " " },
},
mode_icons = {
["n"] = "NORMAL",
["no"] = "NORMAL",
["nov"] = "NORMAL",
["noV"] = "NORMAL",
["niI"] = "NORMAL",
["niR"] = "NORMAL",
["niV"] = "NORMAL",
["i"] = "INSERT",
["ic"] = "INSERT",
["ix"] = "INSERT",
["s"] = "INSERT",
["S"] = "INSERT",
["v"] = "VISUAL",
["V"] = "VISUAL",
[""] = "VISUAL",
["r"] = "REPLACE",
["r?"] = "REPLACE",
["R"] = "REPLACE",
["c"] = "COMMAND",
["t"] = "TERMINAL",
},
})
'';
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.treesitter-context = {
enable = true;
};
}

View file

@ -1,50 +0,0 @@
{
programs.nixvim.plugins.treesitter-textobjects = {
enable = false;
select = {
enable = true;
lookahead = true;
keymaps = {
"aa" = "@parameter.outer";
"ia" = "@parameter.inner";
"af" = "@function.outer";
"if" = "@function.inner";
"ac" = "@class.outer";
"ic" = "@class.inner";
"ii" = "@conditional.inner";
"ai" = "@conditional.outer";
"il" = "@loop.inner";
"al" = "@loop.outer";
"at" = "@comment.outer";
};
};
move = {
enable = true;
gotoNextStart = {
"]m" = "@function.outer";
"]]" = "@class.outer";
};
gotoNextEnd = {
"]M" = "@function.outer";
"][" = "@class.outer";
};
gotoPreviousStart = {
"[m" = "@function.outer";
"[[" = "@class.outer";
};
gotoPreviousEnd = {
"[M" = "@function.outer";
"[]" = "@class.outer";
};
};
swap = {
enable = true;
swapNext = {
"<leader>a" = "@parameters.inner";
};
swapPrevious = {
"<leader>A" = "@parameter.outer";
};
};
};
}

View file

@ -1,46 +0,0 @@
{pkgs, ...}: let
nu-grammar = pkgs.tree-sitter.buildGrammar {
language = "nu";
version = "0.0.0+rev=358c4f5";
src = pkgs.fetchFromGitHub {
owner = "nushell";
repo = "tree-sitter-nu";
rev = "2d0dd587dbfc3363d2af4e4141833e718647a67e";
hash = "sha256-A0Lpsx0VFRYUWetgX3Bn5osCsLQrZzg90unGg9kTnVg=";
};
};
in {
programs.nixvim = {
filetype.extension.liq = "liquidsoap";
filetype.extension.nu = "nu";
plugins.treesitter = {
enable = true;
indent = true;
folding = true;
languageRegister.nu = "nu";
languageRegister.liq = "liquidsoap";
nixvimInjections = true;
grammarPackages =
[
nu-grammar
]
++ pkgs.vimPlugins.nvim-treesitter.allGrammars;
};
extraFiles = {
"/queries/nu/highlights.scm" = builtins.readFile "${nu-grammar}/queries/nu/highlights.scm";
"/queries/nu/injections.scm" = builtins.readFile "${nu-grammar}/queries/nu/injections.scm";
};
extraConfigLua = ''
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.liquidsoap = {
filetype = "liquidsoap",
}
parser_config.nu = {
filetype = "nu",
}
'';
};
}

View file

@ -1,93 +0,0 @@
{
programs.nixvim = {
plugins.alpha = let
nixFlake = [
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
];
in {
enable = true;
layout = [
{
type = "padding";
val = 4;
}
{
opts = {
hl = "AlphaHeader";
position = "center";
};
type = "text";
val = nixFlake;
}
{
type = "padding";
val = 2;
}
{
type = "group";
val = let
mkButton = shortcut: cmd: val: hl: {
type = "button";
inherit val;
opts = {
inherit hl shortcut;
keymap = [
"n"
shortcut
cmd
{}
];
position = "center";
cursor = 0;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
};
in [
(
mkButton
"f"
"<CMD>lua require('telescope.builtin').find_files({hidden = true})<CR>"
"🔍 Find File"
"Operator"
)
(
mkButton
"q"
"<CMD>qa<CR>"
"💣 Quit Neovim"
"String"
)
];
}
{
type = "padding";
val = 2;
}
{
opts = {
hl = "Gruvbox";
position = "center";
};
type = "text";
val = "https://github.com/bloxx12/nichts";
}
];
};
};
}

View file

@ -1,22 +0,0 @@
{pkgs, ...}: {
programs.nixvim = {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "btw.nvim";
version = "2024-04-36";
src = pkgs.fetchFromGitHub {
owner = "letieu";
repo = "btw.nvim";
rev = "47f6419e90d3383987fd06e8f3e06a4bc032ac83";
hash = "sha256-91DZUfa4FBvXnkcNHdllr82Dr1Ie+MGVD3ibwkqo04c=";
};
})
];
extraConfigLua = ''
require('btw').setup({
text = "I use Neovim (and NixOS, BTW)",
})
'';
};
}

View file

@ -1,177 +0,0 @@
{
config,
lib,
...
}: let
colors = import ../../colors/${config.theme}.nix {};
in {
programs.nixvim = {
plugins = {
bufferline = {
enable = true;
separatorStyle = "slant"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin”
highlights = {
fill = {
fg = colors.base00;
bg = colors.base00;
};
background = {
fg = colors.base03;
bg = colors.base00;
};
bufferSelected = {
fg = colors.base05;
bg = colors.base00;
italic = false;
};
bufferVisible = {
fg = colors.base03;
bg = colors.base00;
};
closeButton = {
fg = colors.base03;
bg = colors.base00;
};
closeButtonVisible = {
fg = colors.base03;
bg = colors.base00;
};
closeButtonSelected = {
fg = colors.base08;
bg = colors.base00;
};
indicatorSelected = {
fg = colors.base00;
bg = colors.base00;
};
modified = {
fg = colors.base03;
bg = colors.base00;
};
modifiedVisible = {
fg = colors.base00;
bg = colors.base00;
};
modifiedSelected = {
fg = colors.base0B;
bg = colors.base00;
};
tabClose = {
fg = colors.base00;
bg = colors.base00;
};
};
};
};
keymaps = [
{
mode = "n";
key = "<Tab>";
action = "<cmd>BufferLineCycleNext<cr>";
options = {
desc = "Cycle to next buffer";
};
}
{
mode = "n";
key = "<S-Tab>";
action = "<cmd>BufferLineCyclePrev<cr>";
options = {
desc = "Cycle to previous buffer";
};
}
{
mode = "n";
key = "<S-l>";
action = "<cmd>BufferLineCycleNext<cr>";
options = {
desc = "Cycle to next buffer";
};
}
{
mode = "n";
key = "<S-h>";
action = "<cmd>BufferLineCyclePrev<cr>";
options = {
desc = "Cycle to previous buffer";
};
}
{
mode = "n";
key = "<leader>bd";
action = "<cmd>bdelete<cr>";
options = {
desc = "Delete buffer";
};
}
{
mode = "n";
key = "<leader>bb";
action = "<cmd>e #<cr>";
options = {
desc = "Switch to Other Buffer";
};
}
# {
# mode = "n";
# key = "<leader>`";
# action = "<cmd>e #<cr>";
# options = {
# desc = "Switch to Other Buffer";
# };
# }
{
mode = "n";
key = "<leader>br";
action = "<cmd>BufferLineCloseRight<cr>";
options = {
desc = "Delete buffers to the right";
};
}
{
mode = "n";
key = "<leader>bl";
action = "<cmd>BufferLineCloseLeft<cr>";
options = {
desc = "Delete buffers to the left";
};
}
{
mode = "n";
key = "<leader>bo";
action = "<cmd>BufferLineCloseOthers<cr>";
options = {
desc = "Delete other buffers";
};
}
{
mode = "n";
key = "<leader>bp";
action = "<cmd>BufferLineTogglePin<cr>";
options = {
desc = "Toggle pin";
};
}
{
mode = "n";
key = "<leader>bP";
action = "<Cmd>BufferLineGroupClose ungrouped<CR>";
options = {
desc = "Delete non-pinned buffers";
};
}
];
};
}

View file

@ -1,36 +0,0 @@
{
programs.nixvim.plugins.noice = {
enable = true;
notify = {
enabled = false;
};
messages = {
enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason
};
lsp = {
message = {
enabled = true;
};
progress = {
enabled = false;
view = "mini";
};
};
popupmenu = {
enabled = true;
backend = "nui";
};
format = {
filter = {
pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"];
icon = "";
lang = "regex";
};
replace = {
pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"];
icon = "󱞪";
lang = "regex";
};
};
};
}

View file

@ -1,47 +0,0 @@
{
programs.nixvim = {
plugins.notify = {
enable = true;
backgroundColour = "#000000";
fps = 60;
render = "default";
timeout = 1000;
topDown = true;
};
keymaps = [
{
mode = "n";
key = "<leader>un";
action = ''
<cmd>lua require("notify").dismiss({ silent = true, pending = true })<cr>
'';
options = {
desc = "Dismiss All Notifications";
};
}
];
extraConfigLua = ''
local notify = require("notify")
local filtered_message = { "No information available" }
-- Override notify function to filter out messages
---@diagnostic disable-next-line: duplicate-set-field
vim.notify = function(message, level, opts)
local merged_opts = vim.tbl_extend("force", {
on_open = function(win)
local buf = vim.api.nvim_win_get_buf(win)
vim.api.nvim_buf_set_option(buf, "filetype", "markdown")
end,
}, opts or {})
for _, msg in ipairs(filtered_message) do
if message == msg then
return
end
end
return notify(message, level, merged_opts)
end
'';
};
}

View file

@ -1,212 +0,0 @@
{
programs.nixvim = {
plugins.telescope = {
enable = true;
extensions = {
file-browser = {
enable = true;
};
fzf-native = {
enable = true;
};
};
settings = {
defaults = {
layout_config = {
horizontal = {
prompt_position = "top";
};
};
sorting_strategy = "ascending";
};
};
keymaps = {
"<leader><space>" = {
action = "find_files, {}";
options = {
desc = "Find project files";
};
};
"<leader>/" = {
action = "live_grep";
options = {
desc = "Grep (root dir)";
};
};
"<leader>:" = {
action = "command_history, {}";
options = {
desc = "Command History";
};
};
"<leader>b" = {
action = "buffers, {}";
options = {
desc = "+buffer";
};
};
"<leader>ff" = {
action = "find_files, {}";
options = {
desc = "Find project files";
};
};
"<leader>fr" = {
action = "live_grep, {}";
options = {
desc = "Find text";
};
};
"<leader>fR" = {
action = "resume, {}";
options = {
desc = "Resume";
};
};
"<leader>fg" = {
action = "oldfiles, {}";
options = {
desc = "Recent";
};
};
"<leader>fb" = {
action = "buffers, {}";
options = {
desc = "Buffers";
};
};
"<C-p>" = {
action = "git_files, {}";
options = {
desc = "Search git files";
};
};
"<leader>gc" = {
action = "git_commits, {}";
options = {
desc = "Commits";
};
};
"<leader>gs" = {
action = "git_status, {}";
options = {
desc = "Status";
};
};
"<leader>sa" = {
action = "autocommands, {}";
options = {
desc = "Auto Commands";
};
};
"<leader>sb" = {
action = "current_buffer_fuzzy_find, {}";
options = {
desc = "Buffer";
};
};
"<leader>sc" = {
action = "command_history, {}";
options = {
desc = "Command History";
};
};
"<leader>sC" = {
action = "commands, {}";
options = {
desc = "Commands";
};
};
"<leader>sD" = {
action = "diagnostics, {}";
options = {
desc = "Workspace diagnostics";
};
};
"<leader>sh" = {
action = "help_tags, {}";
options = {
desc = "Help pages";
};
};
"<leader>sH" = {
action = "highlights, {}";
options = {
desc = "Search Highlight Groups";
};
};
"<leader>sk" = {
action = "keymaps, {}";
options = {
desc = "Keymaps";
};
};
"<leader>sM" = {
action = "man_pages, {}";
options = {
desc = "Man pages";
};
};
"<leader>sm" = {
action = "marks, {}";
options = {
desc = "Jump to Mark";
};
};
"<leader>so" = {
action = "vim_options, {}";
options = {
desc = "Options";
};
};
"<leader>sR" = {
action = "resume, {}";
options = {
desc = "Resume";
};
};
"<leader>uC" = {
action = "colorscheme, {}";
options = {
desc = "Colorscheme preview";
};
};
};
};
keymaps = [
{
mode = "n";
key = "<leader>sd";
action = "<cmd>Telescope diagnostics bufnr=0<cr>";
options = {
desc = "Document diagnostics";
};
}
{
mode = "n";
key = "<leader>fe";
action = "<cmd>Telescope file_browser<cr>";
options = {
desc = "File browser";
};
}
{
mode = "n";
key = "<leader>fE";
action = "<cmd>Telescope file_browser path=%:p:h select_buffer=true<cr>";
options = {
desc = "File browser";
};
}
];
extraConfigLua = ''
require("telescope").setup{
pickers = {
colorscheme = {
enable_preview = true
}
}
}
'';
};
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.comment = {
enable = true;
};
}

View file

@ -1,58 +0,0 @@
{
pkgs,
lib,
...
}: let
copilotChatRepo = {
owner = "copilotc-nvim";
repo = "CopilotChat.nvim";
rev = "2771f1fa7af502ea4226a88a792f4e4319199906";
hash = "sha256-Q+g81BQVQTY5J2c2ZWB7bjJLuNSdI0PAan+75YJ7mI0=";
};
in {
programs.nixvim = {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "copilotchat";
version = "2.4.0";
src = pkgs.fetchFromGitHub copilotChatRepo;
meta = {
description = "Chat with GitHub Copilot in Neovim";
homepage = "https://github.com/CopilotC-Nvim/CopilotChat.nvim/";
license = lib.licenses.gpl3;
};
})
];
extraConfigLua = ''
require("CopilotChat").setup { }
'';
keymaps = [
{
mode = "x";
key = "<leader>a";
action = "+copilot";
}
{
mode = "x";
key = "<leader>ae";
action = "<cmd>CopilotChatExplain<cr>";
}
{
mode = "x";
key = "<leader>af";
action = "<cmd>CopilotChatFix<cr>";
}
{
mode = "x";
key = "<leader>ad";
action = "<cmd>CopilotChatDocs<cr>";
}
{
mode = "x";
key = "<leader>ac";
action = "<cmd>CopilotChatCommit<cr>";
}
];
};
}

View file

@ -1,58 +0,0 @@
{
programs.nixvim = {
plugins.flash = {
enable = true;
labels = "asdfghjklqwertyuiopzxcvbnm";
search = {
mode = "fuzzy";
};
jump = {
autojump = true;
};
label = {
uppercase = false;
rainbow = {
enabled = false;
shade = 5;
};
};
};
keymaps = [
{
mode = ["n" "x" "o"];
key = "s";
action = "<cmd>lua require('flash').jump()<cr>";
options = {
desc = "Flash";
};
}
{
mode = ["n" "x" "o"];
key = "S";
action = "<cmd>lua require('flash').treesitter()<cr>";
options = {
desc = "Flash Treesitter";
};
}
{
mode = "o";
key = "r";
action = "<cmd>lua require('flash').remote()<cr>";
options = {
desc = "Remote Flash";
};
}
{
mode = ["x" "o"];
key = "R";
action = "<cmd>lua require('flash').treesitter_search()<cr>";
options = {
desc = "Treesitter Search";
};
}
];
};
}

View file

@ -1,22 +0,0 @@
{pkgs, ...}: {
programs.nixvim = {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "grapple.nvim";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "cbochs";
repo = "grapple.nvim";
rev = "59d458e378c4884f22b7a68e61c07ed3e41aabf0";
hash = "sha256-4k8BE9i8kG4pL7Fj0xw9cG8sjA0u4jzJ40WSV/lBFhY=";
};
})
];
extraConfigLua = ''
require('grapple').setup({
scope = "git_branch",
})
'';
};
}

View file

@ -1,26 +0,0 @@
{
programs.nixvim.plugins.hardtime = {
enable = true;
enabled = true;
disableMouse = true;
disabledFiletypes = ["Oil"];
hint = true;
maxCount = 2;
maxTime = 1000;
restrictionMode = "hint";
restrictedKeys = {
"h" = ["n" "x"];
"j" = ["n" "x"];
"k" = ["n" "x"];
"l" = ["n" "x"];
"-" = ["n" "x"];
"+" = ["n" "x"];
"gj" = ["n" "x"];
"gk" = ["n" "x"];
"<CR>" = ["n" "x"];
"<C-M>" = ["n" "x"];
"<C-N>" = ["n" "x"];
"<C-P>" = ["n" "x"];
};
};
}

View file

@ -1,17 +0,0 @@
{
programs.nixvim.plugins.harpoon = {
enable = true;
enableTelescope = true;
keymapsSilent = true;
keymaps = {
addFile = "<leader>ha";
toggleQuickMenu = "<C-e>";
navFile = {
"1" = "<leader>hj";
"2" = "<leader>hk";
"3" = "<leader>hl";
"4" = "<leader>hm";
};
};
};
}

View file

@ -1,13 +0,0 @@
{
programs.nixvim.plugins.illuminate = {
enable = true;
underCursor = false;
filetypesDenylist = [
"Outline"
"TelescopePrompt"
"alpha"
"harpoon"
"reason"
];
};
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.lazy = {
enable = true;
};
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.nvim-autopairs = {
enable = true;
};
}

View file

@ -1,52 +0,0 @@
{
programs.nixvim = {
plugins.oil = {
enable = true;
settings = {
useDefaultKeymaps = true;
deleteToTrash = true;
float = {
padding = 2;
maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)'';
maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)'';
border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
winOptions = {
winblend = 0;
};
};
preview = {
border = "rounded";
};
keymaps = {
"g?" = "actions.show_help";
"<CR>" = "actions.select";
"<C-\\>" = "actions.select_vsplit";
"<C-enter>" = "actions.select_split"; # this is used to navigate left
"<C-t>" = "actions.select_tab";
"<C-v>" = "actions.preview";
"<C-c>" = "actions.close";
"<C-r>" = "actions.refresh";
"-" = "actions.parent";
"_" = "actions.open_cwd";
"`" = "actions.cd";
"~" = "actions.tcd";
"gs" = "actions.change_sort";
"gx" = "actions.open_external";
"g." = "actions.toggle_hidden";
"q" = "actions.close";
};
};
};
keymaps = [
{
mode = "n";
key = "-";
action = ":Oil<CR>";
options = {
desc = "Open parent directory";
silent = true;
};
}
];
};
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.nvim-ufo = {
enable = true;
};
}

View file

@ -1,22 +0,0 @@
{
programs.nixvim = {
plugins.undotree = {
enable = true;
settings = {
autoOpenDiff = true;
focusOnToggle = true;
};
};
keymaps = [
{
mode = "n";
key = "<leader>ut";
action = "<cmd>UndotreeToggle<CR>";
options = {
silent = true;
desc = "Undotree";
};
}
];
};
}

View file

@ -1,5 +0,0 @@
{
programs.nixvim.plugins.which-key = {
enable = true;
};
}

View file

@ -1,87 +0,0 @@
{
config = {
programs.nixvim.opts = {
# Enable relative line numbers
number = true;
relativenumber = true;
# Set tabs to 2 spaces
tabstop = 2;
softtabstop = 2;
showtabline = 2;
expandtab = true;
# Enable auto indenting and set it to spaces
smartindent = true;
shiftwidth = 2;
# Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim)
breakindent = true;
# Enable incremental searching
hlsearch = true;
incsearch = true;
# Enable text wrap
wrap = true;
# Better splitting
splitbelow = true;
splitright = true;
# Enable mouse mode
mouse = "a"; # Mouse
# Enable ignorecase + smartcase for better searching
ignorecase = true;
smartcase = true; # Don't ignore case with capitals
grepprg = "rg --vimgrep";
grepformat = "%f:%l:%c:%m";
# Decrease updatetime
updatetime = 50; # faster completion (4000ms default)
# Set completeopt to have a better completion experience
completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp
# Enable persistent undo history
swapfile = false;
backup = false;
undofile = true;
# Enable 24-bit colors
termguicolors = true;
# Enable the sign column to prevent the screen from jumping
# signcolumn = "yes";
# Enable cursor line highlight
cursorline = true; # Highlight the line where the cursor is located
# Set fold settings
# These options were reccommended by nvim-ufo
# See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration
foldcolumn = "0";
foldlevel = 99;
foldlevelstart = 99;
foldenable = true;
# Always keep 8 lines above/below cursor unless at start/end of file
scrolloff = 8;
# Place a column line
# colorcolumn = "80";
# Reduce which-key timeout to 10ms
timeoutlen = 10;
# Set encoding type
encoding = "utf-8";
fileencoding = "utf-8";
# More space in the neovim command line for displaying messages
cmdheight = 0;
# We don't need to see things like INSERT anymore
showmode = false;
};
};
}

View file

@ -1,4 +1,3 @@
# credits to raf, his repo is in the README.md!
{
pkgs,
config,
@ -6,10 +5,12 @@
inputs,
...
}: let
cfg = config.modules.system.programs.editors.neovim;
inherit (builtins) filter map toString elem;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
inherit (lib.lists) concatLists;
inherit (lib) mkIf;
mkNeovimModule = {
path,
@ -23,6 +24,7 @@
nvf = inputs.neovim-flake;
in {
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
typstyle
];
@ -33,4 +35,5 @@ in {
# which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;})
];
};
}

View file

@ -5,23 +5,17 @@
pkgs,
...
}: let
cfg = config.modules.programs.foot;
cfg = config.modules.system.programs.terminals.foot;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
inherit (lib) mkIf;
in {
options.modules.programs.foot = {
enable = mkEnableOption "foot";
server = mkEnableOption "foot server mode";
};
config = mkIf cfg.enable {
environment.sessionVariables = {TERM = "foot";};
home-manager.users.${username} = {
programs.foot = {
enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot;
server.enable = cfg.server;
settings = {
main = {
term = "foot";

View file

@ -1,26 +1,21 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.kitty;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.terminals.kitty;
inherit (config.modules.other.system) username;
in {
options.modules.programs.kitty.enable = mkEnableOption "kitty";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.kitty = {
enable = true;
settings = {
# font_size = "13.0";
mouse_hide_wait = -1;
allow_remote_control = true;
url_style = "curly";
open_url_with = "default";
#background_opacity = "0.9";
confirm_os_window_close = "0";
};
};

View file

@ -4,13 +4,11 @@
lib,
...
}: let
cfg = config.modules.programs.schizofox;
cfg = config.modules.system.programs.firefox;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
inherit (lib) mkIf;
in {
options.modules.programs.schizofox = {enable = mkEnableOption "schizofox";};
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.schizofox.homeManagerModule];

View file

@ -5,12 +5,11 @@
inputs,
...
}: let
cfg = config.modules.programs.spicetify;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.spotify;
inherit (config.modules.other.system) username;
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default;
# inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix;
in {
options.modules.programs.spicetify.enable = lib.mkEnableOption "spicetify";
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.spicetify-nix.homeManagerModule];

View file

@ -5,11 +5,9 @@
...
}:
with lib; let
cfg = config.modules.programs.vesktop;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.discord;
inherit (config.modules.other.system) username;
in {
options.modules.programs.vesktop = {enable = mkEnableOption "vesktop";};
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [vesktop];

View file

@ -5,7 +5,7 @@
...
}:
with lib; let
cfg = config.modules.programs.zathura;
cfg = config.modules.system.programs.zathura;
inherit (config.modules.other.system) username;
catppuccin = pkgs.fetchFromGitHub {
owner = "catppuccin";
@ -14,8 +14,6 @@ with lib; let
hash = "sha256-/vD/hOi6KcaGyAp6Az7jL5/tQSGRzIrf0oHjAJf4QbI=";
};
in {
options.modules.programs.zathura.enable = mkEnableOption "zathura";
config = mkIf cfg.enable {
home-manager.users.${username} = {
xdg.configFile."zathura/catppuccin-mocha".source = "${catppuccin}/src/catppuccin-mocha";

View file

@ -0,0 +1,118 @@
{
config,
lib,
...
}: let
inherit (builtins) elemAt;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.modules) mkMerge;
inherit (lib.lists) optionals;
inherit (lib.types) enum listOf str nullOr bool package;
in {
imports = [
# configuration options for nixos activation scripts
# ./activation.nix
# boot/impermanence mounts
# ./boot.nix
# ./impermanence.nix
# network and overall hardening
./networking
# ./security.nix
# ./encryption.nix
# filesystems
# ./fs.nix
# emulation and virtualization
# ./emulation.nix
# ./virtualization.nix
# package and program related options
# ./services
./programs
# systemd-nspawn containers
# ./containers.nix
];
config = {
warnings = mkMerge [
(optionals (config.modules.system.users == []) [
''
You have not added any users to be supported by your system. You may end up with an unbootable system!
Consider setting {option}`config.modules.system.users` in your configuration
''
])
];
};
options.modules.system = {
mainUser = mkOption {
type = enum config.modules.system.users;
default = elemAt config.modules.system.users 0;
description = ''
The username of the main user for your system.
In case of a multiple systems, this will be the user with priority in ordered lists and enabled options.
'';
};
users = mkOption {
type = listOf str;
default = ["charlie"];
description = "A list of home-manager users on the system.";
};
autoLogin = mkOption {
type = bool;
default = false;
description = ''
Whether to enable passwordless login. This is generally useful on systems with
FDE (Full Disk Encryption) enabled. It is a security risk for systems without FDE.
'';
};
yubikeySupport = {
enable = mkEnableOption "yubikey support";
deviceType = mkOption {
type = nullOr (enum ["NFC5" "nano"]);
default = null;
description = "A list of device models to enable Yubikey support for";
};
};
sound = {
enable = mkEnableOption "sound related programs and audio-dependent programs";
};
video = {
enable = mkEnableOption "video drivers and programs that require a graphical user interface";
};
bluetooth = {
enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)";
};
# should the device enable printing module and try to load common printer modules
# you might need to add more drivers to the printing module for your printer to work
printing = {
enable = mkEnableOption "printing";
extraDrivers = mkOption {
type = listOf str;
default = [];
description = "A list of extra drivers to enable for printing";
};
"3d" = {
enable = mkEnableOption "3D printing suite";
extraPrograms = mkOption {
type = listOf package;
default = [];
description = "A list of extra programs to enable for 3D printing";
};
};
};
};
}

View file

@ -0,0 +1,7 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkOption types;
in {
options.modules.system.networking = {
nftbles.enable = mkEnableOption "Nftables firewall";
};
}

View file

@ -0,0 +1,53 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkOption types;
in {
options.modules.system.programs = {
editors = {
emacs.enable = mkEnableOption "Emacs operatig system";
neovim.enable = mkEnableOption "Neovim text editor";
helix.enable = mkEnableOption "Helix text editor";
kakoune.enable = mkEnableOption "Kakoune text editor";
};
discord.enable = mkEnableOption "Discord messenger";
spotify.enable = mkEnableOption "Spotify music client";
zathura.enable = mkEnableOption "Zathura pdf viewer";
nextcloud.enable = mkEnableOption "Nextcloud sync client";
firefox.enable = mkEnableOption "Firefox web browser";
terminals = {
foot.enable = mkEnableOption "Foot terminal emulator";
kitty.enable = mkEnableOption "Kitty terminal emulator";
};
git = {
signingKey = mkOption {
type = types.str;
default = "";
description = "The default gpg key used for signing commits";
};
};
default = {
terminal = mkOption {
type = types.enum ["foot" "kitty"];
default = "foot";
};
fileManager = mkOption {
type = types.enum ["thunar" "dolphin" "nemo"];
default = "thunar";
};
browser = mkOption {
type = types.enum ["firefox" "librewolf" "chromium"];
default = "firefox";
};
editor = mkOption {
type = types.enum ["neovim" "helix" "emacs"];
default = "emacs";
};
launcher = mkOption {
type = types.enum ["anyrun" "rofi" "wofi"];
default = "anyrun";
};
};
};
}

View file

@ -0,0 +1,77 @@
{
inputs,
config,
pkgs,
lib,
...
}: let
cfg = config.modules.usrEnv;
inherit (lib.options) mkOption;
inherit (lib.types) bool enum package;
in {
options.modules.usrEnv = {
desktop = mkOption {
type = enum ["none" "Hyprland" "sway" "awesomewm" "i3"];
default = "none";
description = ''
The desktop environment to be used.
'';
};
desktops = {
hyprland = {
enable = mkOption {
type = bool;
default = cfg.desktop == "Hyprland";
description = ''
Whether to enable Hyprland wayland compositor.
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "Hyprland".
'';
};
package = mkOption {
type = package;
default = inputs.hyprland.packages.${pkgs.system}.hyprland;
description = ''
The Hyprland package to be used.
'';
};
};
awesomwm.enable = mkOption {
type = bool;
default = cfg.desktop == "awesomewm";
description = ''
Whether to enable Awesome window manager
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "awesomewm".
'';
};
i3 = {
enable = mkOption {
type = bool;
default = cfg.desktop == "i3";
description = ''
Whether to enable i3 window manager
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "i3".
'';
};
package = mkOption {
type = package;
default = pkgs.i3;
description = ''
The i3 package to be used.
'';
};
};
};
};
}

View file

@ -0,0 +1,9 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.modules.usrEnv.programs.launchers = {
anyrun.enable = mkEnableOption "anyrun application launcher";
rofi.enable = mkEnableOption "rofi application launcher";
tofi.enable = mkEnableOption "tofi application launcher";
};
}

View file

@ -0,0 +1,60 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) bool listOf package;
in {
options.modules.usrEnv.programs.media = {
addDefaultPackages = mkOption {
type = bool;
default = true;
description = ''
Whether to enable the default list of media-related packages ranging from audio taggers
to video editors.
'';
};
extraPackages = mkOption {
type = listOf package;
default = [];
description = ''
Additional packages that will be appended to media related packages.
'';
};
ncmpcpp.enable = mkEnableOption "ncmpcpp TUI music player";
beets.enable =
mkEnableOption ''
beets media library system.
Will be enabled automatically if {option}`config.modules.usrEnv.services.mpd.enabled`
is set to true
''
// {default = config.modules.usrEnv.services.media.mpd.enable;};
mpv = {
enable = mkEnableOption "mpv media player";
scripts = mkOption {
type = listOf package;
description = "A list of MPV scripts that will be enabled";
example = literalExpression ''[ pkgs.mpvScripts.cutter ]'';
default = with pkgs.mpvScripts; [
# from nixpkgs
cutter # cut and automatically concat videos
mpris # MPRIS plugin
thumbnail # OSC seekbar thumbnails
thumbfast # on-the-fly thumbnailer
sponsorblock # skip sponsored segments
uosc # proximity UI
quality-menu # ytdl-format quality menu
seekTo # seek to specific pos.
];
};
};
};
}