Refactor terminal development

This commit is contained in:
muon 2025-12-22 18:18:26 +00:00
parent 76d16b1348
commit 85c51ff9d0
7 changed files with 484 additions and 2133 deletions

View file

@ -18,21 +18,11 @@ in {
imports = [inputs.nvf.homeManagerModules.default];
config = lib.mkIf config.mods.terminal.development.enable {
home.packages = with pkgs; [
# Nix
nil
# Rust
rust-analyzer
lldb_18
# Shaders
glsl_analyzer
wgsl-analyzer
# Python
black
];
mods = {
nvim.enable = true;
helix.enable = true;
zellij.enable = true;
};
programs.direnv = {
enable = true;
@ -40,393 +30,7 @@ in {
enableZshIntegration = lib.mkIf config.mods.terminal.zsh.enable true;
};
programs.zellij = {
settings = {
default_mode._args = ["locked"];
show_startup_tips._args = [false];
show_release_notes._args = [false];
};
extraConfig = builtins.readFile ./zellij/config.kdl;
layouts = {
dev = {
layout = {
_children = [
{
default_tab_template = {
_children = [
{
pane = {
size = 1;
borderless = true;
plugin = {
location = "zellij:tab-bar";
};
};
}
{"children" = {};}
{
pane = {
size = 1;
borderless = true;
plugin = {
location = "zellij:status-bar";
};
};
}
];
};
}
{
tab = {
_props = {
name = "project";
focus = true;
};
_children = [
{
pane = {
command = "zsh";
args = ["-c" "direnv exec . nvim"];
};
}
];
};
}
{
tab = {
_props = {
name = "test";
};
_children = [
{
pane = {};
}
];
};
}
{
tab = {
_props = {
name = "git";
};
_children = [
{
pane = {
command = "lazygit";
};
}
];
};
}
];
};
};
};
};
home.sessionVariables.EDITOR = "hx";
programs.zsh.sessionVariables.EDITOR = "hx";
programs.helix = {
enable = true;
package = pkgs.evil-helix;
settings = {
keys.normal = {
"esc" = ["collapse_selection" "keep_primary_selection"];
"Z" = {
"Q" = ":quit!";
"Z" = ":write-quit!";
};
"V" = ["select_mode" "extend_to_line_bounds"];
};
editor = {
line-number = "relative";
completion-replace = true;
bufferline = "always";
rulers = [80];
soft-wrap.enable = true;
indent-guides.render = true;
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
};
};
languages.language-server = {
glsl.command = "${pkgs.glsl_analyzer}/bin/glsl_analyzer";
wgsl.command = "${pkgs.wgsl-analyzer}/bin/wgsl-analyzer";
};
languages.language = [
{
name = "nix";
auto-format = true;
formatter.command = "${pkgs.nixfmt-classic}/bin/nixfmt";
}
{
name = "rust";
auto-format = true;
formatter.command = "rustfmt";
}
{
name = "glsl";
language-servers = ["glsl"];
}
{
name = "wgsl";
language-servers = ["wgsl"];
}
{
name = "python";
auto-format = true;
formatter = {
command = "${pkgs.black}/bin/black";
args = ["-" "--quiet" "--line-length=79"];
};
}
];
};
programs.nvf = {
enable = true;
settings = {
vim = {
viAlias = false;
vimAlias = true;
lsp = {
enable = true;
formatOnSave = true;
};
keymaps = [
{
key = "<leader>w";
mode = ["n"];
action = ":w<CR>";
silent = true;
desc = "Save file";
}
{
key = "gd";
mode = "n";
silent = true;
action = "<cmd>lua vim.lsp.buf.definition()<CR>";
desc = "Go to Definition";
}
];
languages = {
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
nix.enable = true;
nix.lsp.servers = ["nixd"];
markdown.enable = true;
bash.enable = true;
rust.enable = true;
rust.extensions.crates-nvim.enable = true;
python.enable = true;
python.lsp.servers = ["pyright"];
# python.lsp.package = [(lib.getExe pkgs.ruff) "server"];
python.format.type = ["ruff" "black"];
clang = {
enable = true;
cHeader = true;
};
};
statusline.lualine.enable = true;
telescope.enable = true;
autocomplete.nvim-cmp.enable = true;
autopairs.nvim-autopairs.enable = true;
tabline.nvimBufferline.enable = true;
treesitter.context.enable = true;
dashboard.alpha.enable = true;
comments.comment-nvim.enable = true;
options = {
tabstop = 2;
shiftwidth = 0;
conceallevel = 2;
};
notes = {
obsidian = lib.mkIf config.mods.obsidian.enable {
enable = true;
setupOpts = {
workspaces = [
{
name = "agentic";
path = "~/work/vaults/agentic";
}
];
completion.nvim_cmp = true;
note_id_func =
lib.generators.mkLuaInline
# lua
''
function(title)
local suffix = ""
if title ~= nil then
-- If title is given, transform it into valid file name.
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
-- If title is nil, just add 4 random uppercase letters to the suffix.
for _ = 1, 4 do
suffix = suffix .. string.char(math.random(65, 90))
end
end
return tostring(os.date("%Y%m%d%H%M%S")) .. "-" .. suffix
end
'';
ui = {
enable = true;
update_debounce = 200;
max_file_length = 5000;
checkboxes = {
" " = {
char = "󰄱";
hl_group = "ObsidianTodo";
};
"x" = {
char = "";
hl_group = "ObsidianDone";
};
">" = {
char = "";
hl_group = "ObsidianRightArrow";
};
"~" = {
char = "󰰱";
hl_group = "ObsidianTilde";
};
"!" = {
char = "";
hl_group = "ObsidianImportant";
};
};
bullets = {
char = "";
hl_group = "ObsidianBullet";
};
external_link_icon = {
char = "";
hl_group = "ObsidianExtLinkIcon";
};
reference_text = {hl_group = "ObsidianRefText";};
highlight_text = {hl_group = "ObsidianHighlightText";};
tags = {hl_group = "ObsidianTag";};
block_ids = {hl_group = "ObsidianBlockID";};
hl_groups = {
ObsidianTodo = {
bold = true;
fg = "#f78c6c";
};
ObsidianDone = {
bold = true;
fg = "#89ddff";
};
ObsidianRightArrow = {
bold = true;
fg = "#f78c6c";
};
ObsidianTilde = {
bold = true;
fg = "#ff5370";
};
ObsidianImportant = {
bold = true;
fg = "#d73128";
};
ObsidianBullet = {
bold = true;
fg = "#89ddff";
};
ObsidianRefText = {
underline = true;
fg = "#c792ea";
};
ObsidianExtLinkIcon = {fg = "#c792ea";};
ObsidianTag = {
italic = true;
fg = "#89ddff";
};
ObsidianBlockID = {
italic = true;
fg = "#89ddff";
};
ObsidianHighlightText = {bg = "#75662e";};
};
};
};
};
todo-comments.enable = true;
};
spellcheck = {enable = true;};
binds = {
whichKey.enable = true;
cheatsheet.enable = true;
};
git = {
enable = true;
gitsigns.enable = true;
gitsigns.codeActions.enable =
false; # throws an annoying debug message
};
terminal = {
toggleterm = {
enable = true;
lazygit.enable = true;
};
};
utility = {
diffview-nvim.enable = true;
surround.enable = true;
# multicursors.enable = true;
undotree.enable = true;
motion = {
hop.enable = true;
leap.enable = true;
};
};
visuals = {
nvim-web-devicons.enable = true;
nvim-cursorline.enable = true;
cinnamon-nvim.enable = true;
fidget-nvim.enable = true;
highlight-undo.enable = true;
indent-blankline.enable = true;
};
ui = {
borders.enable = true;
noice.enable = true;
colorizer.enable = true;
illuminate.enable = true;
smartcolumn.enable = true;
fastaction.enable = true;
};
};
};
};
home.sessionVariables.EDITOR = "nvim";
programs.zsh.sessionVariables.EDITOR = "nvim";
};
}