Moved neovim config to a separate module

This commit is contained in:
2025-08-09 10:06:34 +02:00
parent 7f7d320841
commit 3553270755
19 changed files with 104 additions and 467 deletions

125
flake.lock generated
View File

@@ -52,16 +52,17 @@
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754420989,
"narHash": "sha256-3e4wHzNwTMg7GaeLH9A091DMaO9AfFxUjpfqbddCUeo=",
"lastModified": 1754487366,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7f38f25a44023a21a504bd3fd9d4f41c4a39f55c",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
"type": "github"
},
"original": {
@@ -88,6 +89,24 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -117,11 +136,11 @@
]
},
"locked": {
"lastModified": 1754527677,
"narHash": "sha256-qAzCtmKkMz40xFgP9KN+TCKjVieK4u04EWwl2KvVk0E=",
"lastModified": 1754613544,
"narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "475d35797d9537354d825260cf583114537affc2",
"rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f",
"type": "github"
},
"original": {
@@ -179,11 +198,11 @@
]
},
"locked": {
"lastModified": 1754527677,
"narHash": "sha256-qAzCtmKkMz40xFgP9KN+TCKjVieK4u04EWwl2KvVk0E=",
"lastModified": 1754613544,
"narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "475d35797d9537354d825260cf583114537affc2",
"rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f",
"type": "github"
},
"original": {
@@ -266,11 +285,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1754516867,
"narHash": "sha256-Vlh2o3NqI6a9H/b1aY8uCUsJyJdhwvJZExxnteadLCU=",
"lastModified": 1754662442,
"narHash": "sha256-+nJzzAL+YcU17uuQyfv9KqVIwitbjPf+ZS5P3Qw3E1c=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "a4529beb7c0be3980ce857c60b284a90f2ea6eb6",
"rev": "00da4450db9bab1abfda169eefec8dab98f63a0b",
"type": "github"
},
"original": {
@@ -454,11 +473,13 @@
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nixvim",
"nuschtosSearch",
"nixpkgs"
@@ -529,11 +550,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1754393734,
"narHash": "sha256-fbnmAwTQkuXHKBlcL5Nq1sMAzd3GFqCOQgEQw6Hy0Ak=",
"lastModified": 1754651824,
"narHash": "sha256-aB7ft6njy9EJfuW+rdToNChfRrHNRw/yTg5cSEnG+HI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a683adc19ff5228af548c6539dbc3440509bfed3",
"rev": "b069b7c1e2fe1a3a24221428558bf44128d3d5c8",
"type": "github"
},
"original": {
@@ -545,11 +566,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1754393734,
"narHash": "sha256-fbnmAwTQkuXHKBlcL5Nq1sMAzd3GFqCOQgEQw6Hy0Ak=",
"lastModified": 1754651824,
"narHash": "sha256-aB7ft6njy9EJfuW+rdToNChfRrHNRw/yTg5cSEnG+HI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a683adc19ff5228af548c6539dbc3440509bfed3",
"rev": "b069b7c1e2fe1a3a24221428558bf44128d3d5c8",
"type": "github"
},
"original": {
@@ -559,21 +580,57 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1754393734,
"narHash": "sha256-fbnmAwTQkuXHKBlcL5Nq1sMAzd3GFqCOQgEQw6Hy0Ak=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a683adc19ff5228af548c6539dbc3440509bfed3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
"nixpkgs-unstable"
],
"nuschtosSearch": "nuschtosSearch",
"systems": "systems_3"
"nixvim": "nixvim_2"
},
"locked": {
"lastModified": 1754506651,
"narHash": "sha256-LcpDSjGtTVU0S+aWJPE3/8RONQV0q8dDuanfCj7mAW0=",
"lastModified": 1754725273,
"narHash": "sha256-E4H4qbfh0SAreQkfCfcWCI71py4qNKGeMAAgrXbLcnY=",
"owner": "Superredstone",
"repo": "nixvim",
"rev": "83ecf9850caac84780290469a25ecd01fbb106df",
"type": "github"
},
"original": {
"owner": "Superredstone",
"repo": "nixvim",
"type": "github"
}
},
"nixvim_2": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_3",
"nuschtosSearch": "nuschtosSearch",
"systems": "systems_4"
},
"locked": {
"lastModified": 1754682350,
"narHash": "sha256-4Dgf0cA/ZJtj9eTzG0yNMRBcd5fll3hhWx2WdwltAP8=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "085ef66994f94226dd3d62921e1d48bf731b663a",
"rev": "832de87d40f9a40430372552ab0b583680187cf3",
"type": "github"
},
"original": {
@@ -584,9 +641,10 @@
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixvim",
"nixpkgs"
]
@@ -687,6 +745,21 @@
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [

View File

@@ -23,8 +23,8 @@
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:Superredstone/nixvim";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
hyprland.url = "github:hyprwm/Hyprland";
};

View File

@@ -5,7 +5,6 @@
./git.nix
./gnome.nix
./kitty.nix
./nvim
./tmux.nix
./zoxide.nix
./mangohud.nix

View File

@@ -1,27 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.lspkind.enable = true;
programs.nixvim.plugins.cmp-nvim-lsp-signature-help.enable = true;
programs.nixvim.plugins.cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; }
{ name = "path"; }
{ name = "buffer"; }
{ name = "dap"; }
];
mapping = {
"<Tab>" = "cmp.mapping.select_next_item()";
"<S-Tab>" = "cmp.mapping.select_prev_item()";
"<C-j>" = "cmp.mapping.scroll_docs(4)";
"<C-k>" = "cmp.mapping.scroll_docs(-4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-Esc>" = "cmp.mapping.close()";
"<CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
};
};
};
}

View File

@@ -1,23 +0,0 @@
{ pkgs, ... }:
{
imports = [
./opts.nix
./lsp.nix
./cmp.nix
./keymaps.nix
./plugins
];
programs.nixvim = {
enable = true;
colorschemes.catppuccin.enable = true;
extraPackages = with pkgs; [
wl-clipboard
];
clipboard.register = "unnamedplus";
clipboard.providers.wl-copy.enable = true;
clipboard.providers.wl-copy.package = pkgs.wl-clipboard;
clipboard.providers.xclip.enable = true;
clipboard.providers.xclip.package = pkgs.xclip;
};
}

View File

@@ -1,169 +0,0 @@
{ ... }:
{
programs.nixvim.keymaps = [
{
action = ":bnext<CR>";
key = "<A-l>";
options = {
silent = true;
desc = "Next tab";
};
mode = "n";
}
{
action = ":bprevious<CR>";
key = "<A-h>";
options = {
silent = true;
desc = "Previous tab";
};
mode = "n";
}
{
action = ":bdelete<CR>";
key = "<S-q>";
options = {
silent = true;
desc = "Next tab";
};
mode = "n";
}
{
action = "<C-\\><C-n>";
key = "<Esc>";
options = {
silent = true;
desc = "Exit terminal insert mode";
};
mode = "t";
}
{
action = ":w<CR>";
key = "<C-s>";
options = {
silent = true;
desc = "Save";
};
mode = "n";
}
{
action = ":lua vim.lsp.buf.format()<CR>";
key = "<C-f>";
options = {
silent = true;
desc = "Format buffer";
};
mode = "n";
}
{
action = ":q<CR>";
key = "<C-q>";
options = {
silent = true;
desc = "Quit";
};
mode = "n";
}
{
action = ":wincmd l<CR>";
key = "<Space>wl";
options = {
silent = true;
desc = "Go to left panel";
};
mode = "n";
}
{
action = ":wincmd k<CR>";
key = "<Space>wk";
options = {
silent = true;
desc = "Go to upper panel";
};
mode = "n";
}
{
action = ":wincmd j<CR>";
key = "<Space>wj";
options = {
silent = true;
desc = "Go to down panel";
};
mode = "n";
}
{
action = ":wincmd h<CR>";
key = "<Space>wh";
options = {
silent = true;
desc = "Go to left panel";
};
mode = "n";
}
{
action = "$";
key = "gl";
options = {
silent = true;
desc = "Go to end line";
};
mode = [ "n" "v" ];
}
{
action = "^";
key = "gh";
options = {
silent = true;
desc = "Go to start line";
};
mode = [ "n" "v" ];
}
# Neotree
{
action = ":Neotree toggle<CR>";
key = "<Space>e";
options = {
silent = true;
desc = "Toggle file explorer";
};
mode = "n";
}
# ToggleTerm
{
action = ":ToggleTerm direction=float<CR>";
key = "<Space>t";
options = {
silent = true;
desc = "Toggle terminal";
};
mode = "n";
}
# Dap
{
action.__raw = ''
function()
require("dap").toggle_breakpoint()
end
'';
key = "<Space>b";
mode = "n";
options = {
silent = true;
desc = "Toggle breakpoint";
};
}
{
action.__raw = ''
function()
require("dapui").toggle()
end
'';
key = "<Space>y";
mode = "n";
options = {
silent = true;
desc = "Toggle debugger";
};
}
];
}

View File

@@ -1,36 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.lsp = {
enable = true;
servers = {
clangd.enable = true;
nil_ls.enable = true;
gopls.enable = true;
jdtls.enable = true;
lua_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = false;
installRustc = false;
installRustfmt = false;
};
zls.enable = true;
nim_langserver.enable = true;
pyright.enable = true;
emmet_language_server.enable = true;
ts_ls.enable = true;
docker_compose_language_service.enable = true;
jsonls.enable = true;
phpactor.enable = true;
gleam.enable = true;
elixirls.enable = true;
};
keymaps = {
lspBuf = {
"<Space>k" = "hover";
"<Space>r" = "rename";
"<Space>a" = "code_action";
};
};
};
}

View File

@@ -1,17 +0,0 @@
{ ... }:
{
programs.nixvim.opts = {
number = true;
relativenumber = true;
signcolumn = "yes";
splitright = true;
splitbelow = true;
cursorline = true;
scrolloff = 5;
undofile = true;
ignorecase = true;
smartcase = true;
gdefault = true;
termguicolors = true;
};
}

View File

@@ -1,10 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.comment = {
enable = true;
settings.toggler = {
block = "<C-x>";
line = "<C-c>";
};
};
}

View File

@@ -1,66 +0,0 @@
{ pkgs, ... }:
{
programs.nixvim.plugins = {
dap = {
enable = true;
adapters = {
executables = {
gdb = {
command = "gdb";
args = [
"-i"
"dap"
];
};
lldb = {
command = "lldb";
};
};
servers = {
codelldb = {
port = 13000;
executable = {
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
args = [
"--port"
"13000"
];
};
};
};
};
configurations = {
cpp = [
{
name = "Launch GDB";
type = "gdb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end'';
}
{
name = "Launch LLDB";
type = "lldb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end'';
}
{
name = "Launch CodeLLDB";
type = "codelldb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end'';
}
];
};
};
dap-ui.enable = true;
};
}

View File

@@ -1,20 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.dashboard = {
enable = true;
settings.config = {
header = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
];
footer = [ "Made with " ];
};
};
}

View File

@@ -1,24 +0,0 @@
{ pkgs, ... }:
{
imports = [
./comment.nix
./dap.nix
./dashboard.nix
./guess-indent.nix
./lualine.nix
./neotree.nix
./telescope.nix
./treesitter.nix
];
programs.nixvim.plugins = {
web-devicons.enable = true;
bufferline.enable = true;
toggleterm.enable = true;
gitsigns.enable = true;
which-key.enable = true;
autoclose.enable = true;
markview.enable = true;
nvim-surround.enable = true;
};
}

View File

@@ -1,6 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.guess-indent = {
enable = true;
};
}

View File

@@ -1,6 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.lualine = {
enable = true;
};
}

View File

@@ -1,10 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.neo-tree = {
enable = true;
window = {
width = 30;
};
};
}

View File

@@ -1,10 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.telescope = {
enable = true;
keymaps = {
"<Space>f" = "find_files";
"<Space>g" = "live_grep";
};
};
}

View File

@@ -1,11 +0,0 @@
{ ... }:
{
programs.nixvim.plugins.treesitter = {
enable = true;
settings = {
highlight = {
enable = true;
};
};
};
}

View File

@@ -69,6 +69,7 @@ let
workSystem = workSystem;
isWSL = isWSL;
isDarwin = isDarwin;
nixvim = nixvim;
inputs = inputs;
};
in
@@ -91,7 +92,6 @@ systemFunc {
home-manager.users.${user} = import HMConfig;
home-manager.extraSpecialArgs = specialArgs;
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
];
}
machineConfig

View File

@@ -1,4 +1,4 @@
{ pkgs, gamingSystem, workSystem, currentSystemDe, ... }:
{ pkgs, gamingSystem, workSystem, currentSystemDe, ... }@ inputs:
{
environment.systemPackages = with pkgs; [
# CLI utils
@@ -40,7 +40,7 @@
man-pages
vim # The only and one great editor
# neovim # The only and one great editor improved even further
inputs.nixvim.packages.${system}.default # The only and one great editor improved even further
# Video card
vulkan-tools