This commit is contained in:
unexplrd
2025-02-06 00:33:06 +02:00
commit 2e6e28ef32
254 changed files with 28562 additions and 0 deletions

View File

@ -0,0 +1,122 @@
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.editor.helix;
in {
options = {
editor.helix.enable =
mkEnableOption "enable helix editor";
};
config = mkIf cfg.enable {
programs.helix = {
enable = true;
defaultEditor = true;
settings = {
editor = {
line-number = "relative";
bufferline = "multiple";
cursorline = true;
lsp.display-messages = true;
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = ["mode" "spinner" "version-control"];
center = ["file-name"];
right = ["diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type"];
separator = "|";
};
soft-wrap = {
enable = true;
max-wrap = 25;
max-indent-retain = 0;
wrap-indicator = "";
};
};
keys.normal = {
space = {
space = "file_picker";
w = ":w";
q = ":q";
x = ":x";
n = ":n";
"," = "goto_previous_buffer";
"." = "goto_next_buffer";
l = ":reflow";
};
esc = ["collapse_selection" "keep_primary_selection"];
};
};
languages = {
language-server = {
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
};
rust-analyzer = {
command = "${pkgs.rust-analyzer}/bin/rust-analyzer";
};
texlab = {
command = "${pkgs.texlab}/bin/texlab";
};
nil = {
command = "${pkgs.nil}/bin/nil";
};
markdown-oxide = {
command = "${pkgs.markdown-oxide}/bin/markdown-oxide";
};
tinymist = {
command = lib.getExe pkgs.tinymist;
};
};
language = [
{
name = "nix";
auto-format = true;
formatter.command = "${pkgs.alejandra}/bin/alejandra";
language-servers = ["nil"];
}
{
name = "latex";
auto-format = true;
formatter.command = "${pkgs.texlivePackages.latexindent}/bin/latexindent";
language-servers = ["texlab"];
}
{
name = "typst";
auto-format = true;
formatter.command = lib.getExe pkgs.typstyle;
language-servers = ["tinymist"];
}
{
name = "markdown";
auto-format = true;
formatter.command = "${pkgs.comrak}/bin/comrak";
language-servers = ["markdown-oxide"];
}
{
name = "c";
auto-format = true;
formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
{
name = "cpp";
auto-format = true;
formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
{
name = "rust";
auto-format = true;
language-servers = ["rust-analyzer"];
formatter.command = "${pkgs.rustfmt}/bin/rustfmt";
}
];
};
};
};
}

View File

@ -0,0 +1,8 @@
{
imports = [
./helix.nix
./zed.nix
./neve.nix
#./nixvim.nix
];
}

View File

@ -0,0 +1,28 @@
{
pkgs,
lib,
inputs,
config,
...
}:
with lib; let
cfg = config.editor.neve;
in {
options = {
editor.neve.enable =
mkEnableOption "enable neve neovim distribution";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
neovide
cpplint
statix
];
programs.nixvim = {
enable = true;
imports = [inputs.neve.nixvimModule];
viAlias = true;
vimAlias = true;
};
};
}

View File

@ -0,0 +1,270 @@
{
pkgs,
pkgs-51b85c,
lib,
config,
...
}: {
options = {
editor.neovim.enable =
lib.mkEnableOption "enable neovim text editor";
};
config = lib.mkIf config.editors.neovim.enable {
# stylix.targets.nixvim.enable = true;
home.packages = with pkgs; [neovide];
programs.nixvim = {
enable = true;
enableMan = true;
# package = ;
plugins.lualine.enable = true;
plugins.treesitter = {
enable = true;
folding = true;
};
plugins = {
yazi.enable = true;
noice = {
enable = true;
popupmenu.backend = "nui";
};
notify.enable = true;
telescope.enable = true;
transparent.enable = true;
lsp-format.enable = true;
lsp-lines.enable = true;
lsp-status.enable = true;
which-key.enable = true;
web-devicons.enable = true;
# vimtex = {
# enable = true;
# texlivePackage = pkgs.tectonic; #pkgs.texlive.combined.scheme-full;
# settings = {
# compiler_method = "tectonic";
# view_method = "zathura_simple";
# compiler_tectonic = {
# "aux_dir" = {};
# "out_dir" = {};
# "callback" = 1;
# "continuous" = 0;
# "executable" = "latexmk";
# "hooks" = {};
# "options" = [
# "--synctex"
# "--keep-logs"
# "-Z shell-escape"
# "-Z continue-on-errors"
# ];
# };
# compiler_latexmk = {
# "aux_dir" = {};
# "out_dir" = {};
# "callback" = 1;
# "continuous" = 0;
# "executable" = "latexmk";
# "hooks" = {};
# "options" = [
# "-xelatex"
# "-recorder"
# "-file-line-error"
# "-synctex=1"
# "-interaction=nonstopmode"
# "-shell-escape"
# ];
# };
# };
# };
treesitter-textobjects.enable = true;
cmp-latex-symbols.enable = true;
dap.enable = true;
rustaceanvim.enable = true;
lsp = {
enable = true;
servers = {
clangd.enable = true;
#rust_analyzer = {
# enable = true;
# installRustc = true;
# installCargo = true;
#};
lua_ls.enable = true;
nil_ls.enable = true;
};
};
};
plugins = {
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 = true;}; # autocomplete for cmdline
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{name = "nvim_lsp";}
{name = "path";}
{name = "buffer";}
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
};
experimental = {
ghost_text = true;
};
};
};
luasnip = {
enable = true;
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
};
};
clipboard = {
providers.wl-copy.enable = true;
};
globals.mapleader = " ";
globals.maplocalleader = ",";
opts = {
# Show line numbers
number = true;
# Show relative line numbers
relativenumber = true;
# Use the system clipboard
clipboard = "unnamedplus";
# Number of spaces that represent a <TAB>
tabstop = 2;
softtabstop = 2;
# Show tabline always
showtabline = 2;
# Use spaces instead of tabs
expandtab = true;
# Enable smart indentation
smartindent = true;
# Number of spaces to use for each step of (auto)indent
shiftwidth = 2;
# Enable break indent
breakindent = true;
# Highlight the screen line of the cursor
cursorline = true;
# Minimum number of screen lines to keep above and below the cursor
scrolloff = 8;
# Enable mouse support
mouse = "a";
# Set folding method to manual
foldmethod = "manual";
# Disable folding by default
foldenable = false;
# Wrap long lines at a character in 'breakat'
linebreak = true;
# Disable spell checking
spell = false;
# Disable swap file creation
swapfile = false;
# Time in milliseconds to wait for a mapped sequence to complete
timeoutlen = 300;
# Enable 24-bit RGB color in the TUI
termguicolors = true;
# Don't show mode in the command line
showmode = false;
# Open new split below the current window
splitbelow = true;
# Keep the screen when splitting
splitkeep = "screen";
# Open new split to the right of the current window
splitright = true;
# Hide command line unless needed
cmdheight = 0;
# Remove EOB
fillchars = {
eob = " ";
};
};
keymaps = [
{
mode = "n";
key = "j";
action = "gj";
}
{
mode = "n";
key = "k";
action = "gk";
}
{
mode = "n";
key = "n";
action = "nzzzv";
}
{
mode = "n";
key = "N";
action = "Nzzzv";
}
{
mode = "n";
key = "<C-d>";
action = "<C-d>zz";
}
{
mode = "n";
key = "<C-u>";
action = "<C-u>zz";
}
{
mode = "n";
key = "<leader>yy";
action = "<cmd>Yazi<cr>";
options = {desc = "open yazi";};
}
{
mode = "n";
key = "<leader>fo";
action = "<cmd>Telescope oldfiles<cr>";
options = {desc = "Telescope oldfiles";};
}
{
mode = "n";
key = "<leader>ff";
action = "<cmd>Telescope find_files<cr>";
options = {desc = "Telescope find files";};
}
];
};
};
}

View File

@ -0,0 +1,114 @@
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.editor.zed;
in {
options = {
editor.zed.enable =
mkEnableOption "enable zed editor";
};
config = mkIf cfg.enable {
programs.zed-editor = {
enable = true;
extensions = [
"nix"
"latex"
"typst"
];
userSettings = {
vim_mode = true;
ui_font_size = lib.mkForce 16;
buffer_font_size = lib.mkForce 16;
features = {inline_completion_provider = "none";};
auto_update = false;
languages = {
"Nix" = {
language-servers = [
"nil"
"!nixd"
];
formatter = {
external.command = lib.getExe pkgs.alejandra;
};
};
"Rust" = {
formatter = {
external = {
command = lib.getExe pkgs.rustfmt;
arguments = ["--edition" "2021"];
};
};
};
"typst" = {
language-servers = ["tinymist"];
format_on_save = "on";
formatter = {
external = {
command = lib.getExe pkgs.typstyle;
arguments = ["-i" "{buffer_path}"];
};
};
};
"Python" = {
format_on_save = "on";
formatter = [
{
language_server = {
name = "ruff";
};
}
];
language_servers = ["ruff"];
};
};
lsp = {
clangd = {
binary = {
arguments = [];
path = "${pkgs.clang-tools}/bin/clangd";
};
};
rust-analyzer = {
binary = {
arguments = [];
path = lib.getExe pkgs.rust-analyzer;
};
};
ruff = {
binary = {
arguments = [];
path = lib.getExe pkgs.ruff;
};
};
nil = {
binary = {
arguments = [];
path = lib.getExe pkgs.nil;
};
initialization_options.formatting.command = [(lib.getExe pkgs.alejandra)];
};
texlab = {
binary = {
arguments = [];
path = lib.getExe pkgs.texlab;
};
};
tinymist = {
binary = {
arguments = [];
path = lib.getExe pkgs.tinymist;
};
};
};
telemetry = {
diagnostics = false;
metrics = false;
};
};
};
};
}