Compare commits

...

4 Commits

Author SHA1 Message Date
df0600601b add stuff 2025-04-23 09:58:34 +02:00
6eb4b228ff feat: improve nvim 2025-04-08 12:16:13 +02:00
c020c969d0 update system 2025-04-02 11:56:26 +02:00
cf25eb2ad6 update system 2025-03-31 11:55:46 +02:00
12 changed files with 300 additions and 119 deletions

30
flake.lock generated
View File

@@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"lastModified": 1741352980,
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
"type": "github"
},
"original": {
@@ -46,11 +46,11 @@
]
},
"locked": {
"lastModified": 1741955947,
"narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=",
"lastModified": 1743360001,
"narHash": "sha256-HtpS/ZdgWXw0y+aFdORcX5RuBGTyz3WskThspNR70SM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4",
"rev": "b6fd653ef8fbeccfd4958650757e91767a65506d",
"type": "github"
},
"original": {
@@ -127,11 +127,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1742069588,
"narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=",
"lastModified": 1743315132,
"narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5",
"rev": "52faf482a3889b7619003c0daec593a1912fddc1",
"type": "github"
},
"original": {
@@ -150,11 +150,11 @@
"nuschtosSearch": "nuschtosSearch"
},
"locked": {
"lastModified": 1741814789,
"narHash": "sha256-NbHsnnNwiYUcUaS4z8XK2tYpo3G8NXEKxaKkzMgMiLk=",
"lastModified": 1743362786,
"narHash": "sha256-XbXIRDbb8/vLBX1M096l7lM5wfzBTp1ZXfUl9bUhVGU=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "33097dcf776d1fad0ff3842096c4e3546312f251",
"rev": "d81f37256d0a8691b837b74979d27bf89be8ecdd",
"type": "github"
},
"original": {
@@ -173,11 +173,11 @@
]
},
"locked": {
"lastModified": 1738508923,
"narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=",
"lastModified": 1742659553,
"narHash": "sha256-i/JCrr/jApVorI9GkSV5to+USrRCa0rWuQDH8JSlK2A=",
"owner": "NuschtOS",
"repo": "search",
"rev": "86e2038290859006e05ca7201425ea5b5de4aecb",
"rev": "508752835128a3977985a4d5225ff241f7756181",
"type": "github"
},
"original": {

View File

@@ -3,7 +3,7 @@
imports = [ ./hardware-configuration.nix ];
nix = {
package = pkgs.nixVersions.git;
package = pkgs.nixVersions.latest;
settings.experimental-features = [
"nix-command"
"flakes"
@@ -61,8 +61,9 @@
services = {
ollama = {
enable = false;
enable = true;
acceleration = "rocm";
rocmOverrideGfx = "10.3.0";
};
printing = {

View File

@@ -1,6 +1,12 @@
{ pkgs, ... }:
{
xdg.configFile."ranger/rc.conf".source = ./ranger.conf;
services.flatpak.packages = [
{
flatpakref = "https://releases.threema.ch/flatpak/threema-desktop/ch.threema.threema-desktop.flatpakref";
sha256 = "0lghiiiphbkqgiprqirxifldvix0j4k04jh1z9f911shrzjgqq4s";
}
];
home.packages = with pkgs; [
# nix
cachix
@@ -27,6 +33,7 @@
discord
element-desktop
thunderbird
signal-desktop
# cinny-desktop
# office

View File

@@ -38,9 +38,14 @@
mergetool.enable = true;
trouble.enable = true;
undotree.enable = true;
aerial.enable = true;
base = {
completion.enable = true;
completion = {
enable = true;
copilot = true;
};
diagnostics.enable = true;
coverage.enable = true;
find.enable = true;
formatting = {
enable = true;
@@ -82,41 +87,7 @@
};
};
extraPlugins = [ pkgs.vimPlugins.tiny-inline-diagnostic-nvim ];
extraConfigLua = ''
require("tiny-inline-diagnostic").setup({
preset = "modern",
hi = {
arrow = "LineNr",
background = "LineNr",
},
options = {
show_source = true,
use_icons_from_diagnostic = true,
add_messages = true,
throttle = 0,
softwrap = 30,
multiple_diag_under_cursor = true,
multilines = {
enabled = true,
always_show = true,
},
show_all_diags_on_cursorline = false,
enable_on_insert = false,
enable_on_select = false,
severity = {
vim.diagnostic.severity.ERROR,
vim.diagnostic.severity.WARN,
vim.diagnostic.severity.INFO,
vim.diagnostic.severity.HINT,
},
},
})
'';
diagnostics.virtual_text = false;
plugins = {
leap.enable = true;
vim-surround.enable = true;
which-key.enable = true;
schemastore.enable = true;
@@ -129,7 +100,6 @@
line_numbers = false;
};
};
none-ls.settings.debug = true;
lsp.servers = {
html.enable = true;
@@ -141,10 +111,5 @@
jsonls.enable = true;
taplo.enable = true;
};
copilot-lua = {
enable = true;
settings.suggestion.auto_trigger = true;
};
};
}

View File

@@ -0,0 +1,64 @@
{
lib,
config,
...
}:
let
cfg = config.presets.aerial;
in
{
options.presets.aerial = {
enable = lib.mkEnableOption "aerial";
};
config = lib.mkIf cfg.enable {
keymaps = [
{
key = "<C-Up>";
action = # vim
":AerialPrev<CR>";
}
{
key = "<C-Down>";
action = # vim
":AerialNext<CR>";
}
{
key = "fs";
mode = "n";
action = # vim
":Telescope aerial<CR>";
}
];
plugins = {
aerial = {
enable = true;
settings = {
autojump = true;
highlight_on_jump = false;
filter_kind = false;
open_automatic = false;
show_guides = true;
backends = [
"lsp"
"treesitter"
"markdown"
"asciidoc"
"man"
];
layout = {
placement = "edge";
direction = "right";
};
};
};
which-key.settings.spec = [
{
__unkeyed-1 = "fs";
group = "Symbols";
icon = "󰡱";
}
];
};
};
}

View File

@@ -1,19 +1,67 @@
{ lib, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.presets.base.completion;
in
{
options.presets.base.completion = {
enable = lib.mkEnableOption "completion";
copilot = lib.mkEnableOption "Copilot";
ollama = lib.mkEnableOption "Ollama";
};
config = lib.mkIf cfg.enable {
extraConfigLua =
lib.mkIf cfg.ollama
#lua
''
require('minuet').setup({
provider = 'openai_fim_compatible',
n_completions = 1,
context_window = 1024,
provider_options = {
openai_fim_compatible = {
api_key = 'TERM',
name = 'Ollama',
end_point = 'http://localhost:11434/v1/completions',
model = 'deepseek-coder-v2:16b',
optional = {
max_tokens = 56,
stop = { '\n' },
top_p = 0.9,
},
},
},
virtualtext = {
show_on_completion_menu = true,
auto_trigger_ft = { "*" },
keymap = {
accept = '<A-l>',
},
},
throttle = 0,
debounce = 0,
})
'';
plugins = {
luasnip.enable = true;
lspkind = {
enable = true;
mode = "symbol_text";
};
lualine.settings.sections.lualine_x = lib.mkIf cfg.ollama (
lib.mkBefore [
{ __unkeyed-1.__raw = "require('minuet.lualine')"; }
]
);
copilot-lua = lib.mkIf cfg.copilot {
enable = true;
settings.suggestion.auto_trigger = true;
};
cmp = {
enable = true;
settings = {
@@ -53,5 +101,6 @@ in
};
};
};
extraPlugins = lib.mkIf cfg.ollama [ pkgs.vimPlugins.minuet-ai-nvim ];
};
}

View File

@@ -0,0 +1,99 @@
{
lib,
config,
...
}:
let
cfg = config.presets.base.coverage;
in
{
options.presets.base.coverage = {
enable = lib.mkEnableOption "coverage";
};
config = lib.mkIf cfg.enable {
keymaps = [
{
key = "<leader>cs";
action = # vim
":CoverageSummary<CR>";
}
{
key = "<leader>cr";
action = # vim
":CoverageClear<CR>:CoverageLoad<CR>:CoverageShow<CR>";
}
{
key = "<leader>ch";
action = # vim
":CoverageHide<CR>";
}
{
key = "<leader>cc";
action = # vim
":CoverageShow<CR>";
}
];
autoCmd = [
{
event = [ "BufEnter" ];
callback.__raw = # lua
''
function()
local ftype = vim.bo.filetype
local ok, lang = pcall(require, "coverage.languages." .. ftype)
if not ok then
return
end
local config = require("coverage.config")
local util = require("coverage.util")
local Path = require("plenary.path")
local ft_config = config.opts.lang[ftype]
if ft_config == nil then
return
end
local p = Path:new(util.get_coverage_file(ft_config.coverage_file))
if not p:exists() then
return
end
require("coverage").load(true)
end
'';
}
];
plugins = {
coverage = {
enable = true;
autoReload = true;
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>c";
desc = "Coverage";
icon = "󰠞";
}
{
__unkeyed-1 = "<leader>cs";
desc = "Summary";
icon = "";
}
{
__unkeyed-1 = "<leader>cr";
desc = "Reload";
icon = "󰑓";
}
{
__unkeyed-1 = "<leader>ch";
desc = "Hide";
icon = "󱨃";
}
{
__unkeyed-1 = "<leader>cc";
desc = "Show";
icon = "󱨂";
}
];
};
};
}

View File

@@ -16,27 +16,17 @@ in
extraConfigLuaPre = # lua
''
vim.lsp.set_log_level("off")
require("actions-preview").setup({})
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "󰌵" },
{ name = "DiagnosticSignInfo", text = "" },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "solid" })
'';
diagnostics = {
signs.text = {
"__rawKey__vim.diagnostic.severity.ERROR" = "";
"__rawKey__vim.diagnostic.severity.WARN" = "";
"__rawKey__vim.diagnostic.severity.INFO" = "";
"__rawKey__vim.diagnostic.severity.HINT" = "󰌵";
virtual_text.prefix = "";
signs = false;
float = {
focusable = false;
header = "";
border = "solid";
scope = "cursor";
prefix = "";
};
underline = true;
update_in_insert = true;
@@ -44,11 +34,11 @@ in
};
keymaps = [
{
key = "<leader>sa";
key = "<leader>sn";
mode = "n";
options.silent = true;
action.__raw = # lua
"require('actions-preview').code_actions";
"function() vim.diagnostic.open_float(nil) end";
}
{
key = "<leader>sx";
@@ -68,13 +58,6 @@ in
mode = "n";
action = ":IncRename ";
}
{
key = "<leader>sn";
mode = "n";
options.silent = true;
action.__raw = # lua
"vim.lsp.buf.hover";
}
{
key = "<leader>sh";
mode = "n";
@@ -86,7 +69,7 @@ in
plugins = {
lsp = {
enable = true;
inlayHints = false;
inlayHints = true;
};
telescope = {
enable = true;
@@ -96,6 +79,7 @@ in
"<leader>si" = "lsp_implementations";
"<leader>sw" = "lsp_workspace_symbols";
"<leader>st" = "lsp_type_definitions";
"<leader>sa" = "quickfix";
};
};
inc-rename.enable = true;
@@ -105,11 +89,6 @@ in
group = "LSP";
icon = "󱐋";
}
{
__unkeyed-1 = "<leader>sn";
desc = "Hover";
icon = "";
}
{
__unkeyed-1 = "<leader>sr";
desc = "References";
@@ -155,6 +134,11 @@ in
desc = "Code Actions";
icon = "";
}
{
__unkeyed-1 = "<leader>sn";
desc = "Diagnostics";
icon = "";
}
{
__unkeyed-1 = "<leader>sx";
desc = "LSP Format";
@@ -162,6 +146,5 @@ in
}
];
};
extraPlugins = [ pkgs.vimPlugins.actions-preview-nvim ];
};
}

View File

@@ -13,36 +13,48 @@ in
telescope = {
enable = true;
keymaps = {
"<leader>ff" = "git_files";
"<leader>fa" = "find_files";
"<leader>fg" = "live_grep";
"<leader>fb" = "buffers";
"ff" = {
action = "git_files";
mode = "n";
};
"fa" = {
action = "find_files";
mode = "n";
};
"fg" = {
action = "live_grep";
mode = "n";
};
"fc" = {
action = "buffers";
mode = "n";
};
};
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>f";
__unkeyed-1 = "f";
group = "Find";
icon = "󰍉";
}
{
__unkeyed-1 = "<leader>ff";
__unkeyed-1 = "ff";
desc = "File";
icon = "󰈢";
}
{
__unkeyed-1 = "<leader>fa";
desc = "Untracked Files";
__unkeyed-1 = "fa";
desc = "All Files";
icon = "󱪡";
}
{
__unkeyed-1 = "<leader>fg";
__unkeyed-1 = "fg";
desc = "Grep";
icon = "󰑑";
}
{
__unkeyed-1 = "<leader>fb";
desc = "Buffer";
__unkeyed-1 = "fc";
desc = "Current";
icon = "󰈙";
}
];

View File

@@ -10,12 +10,10 @@ in
config = lib.mkIf cfg.enable {
keymaps = [
{
key = "<leader>ft";
action = "<cmd>:Neotree toggle<CR>";
}
{
key = "<leader>ss";
action = "<cmd>:Neotree document_symbols right toggle<CR>";
key = "ft";
mode = "n";
action = # vim
"<cmd>:Neotree toggle<CR>";
}
];
plugins = {
@@ -27,8 +25,9 @@ in
followCurrentFile.enabled = true;
filteredItems.visible = true;
};
extraSources = [ "document_symbols" ];
popupBorderStyle = "solid";
popupBorderStyle = "rounded";
filesystem.window.mappings.f = "noop";
window.mappings.f = "noop";
eventHandlers.neo_tree_buffer_leave = # lua
''
function()
@@ -38,15 +37,10 @@ in
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>ft";
__unkeyed-1 = "ft";
desc = "Tree";
icon = "󰙅";
}
{
__unkeyed-1 = "<leader>ss";
desc = "Document Symbols";
icon = "󱏒";
}
];
};
};

View File

@@ -6,6 +6,7 @@
inherit pkgs;
};
modules = [
./aerial.nix
./auto-save.nix
./auto-format.nix
./harpoon.nix
@@ -15,6 +16,7 @@
./undotree.nix
./base/completion.nix
./base/coverage.nix
./base/diagnostics.nix
./base/find.nix
./base/formatting.nix

View File

@@ -82,6 +82,10 @@ hi! ErrorMsg guibg={{colors.danger_container.default.hex}} guifg={{colors.on_dan
hi! WarningMsg guibg={{colors.warning_container.default.hex}} guifg={{colors.on_warning_container.default.hex}}
hi! NvimInternalError guibg={{colors.danger.default.hex}} guifg={{colors.on_danger.default.hex}}
hi! CoverageCovered guifg={{colors.success.default.hex}}
hi! CoverageUncovered guifg={{colors.danger.default.hex}}
hi! CoveragePartial guifg={{colors.warning.default.hex}}
hi! DiagnosticError guifg={{colors.danger.default.hex}}
hi! DiagnosticWarn guifg={{colors.warning.default.hex}}
hi! DiagnosticInfo guifg={{colors.info.default.hex}}
@@ -204,12 +208,13 @@ hi! link @keyword.import.cpp PreProc
hi! Type gui=none guifg={{colors.types.default.hex}}
hi! link @lsp.type.interface Type
hi! link AerialLine CursorLine
hi! IlluminatedWordText gui=none guibg={{colors.surface_container_highest.default.hex}}
hi! IlluminatedWordRead gui=none guibg={{colors.surface_container_highest.default.hex}}
hi! IlluminatedWordWrite gui=none guibg={{colors.surface_container_highest.default.hex}}
hi! MatchParen gui=none guibg={{colors.surface_container_highest.default.hex}}
hi! LspInlayHint guifg={{colors.on_surface_variant.default.hex}} guibg={{colors.surface_variant.default.hex}}
hi! LspInlayHint gui=italic guifg={{colors.outline.default.hex}} guibg={{colors.surface_container_highest.default.hex}}
let g:lualine_theme = {
\ "insert": {