Changed Neovim to use Nixvim instead of Lazyvim.

Moved Neovim into its own directory
This commit is contained in:
2026-02-19 11:53:22 +01:00
parent 69aaea8526
commit 66ef4b89af
6 changed files with 192 additions and 101 deletions

63
flake.lock generated
View File

@ -85,6 +85,27 @@
} }
}, },
"flake-parts": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769996383,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"stylix", "stylix",
@ -336,6 +357,28 @@
"type": "github" "type": "github"
} }
}, },
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
},
"locked": {
"lastModified": 1771135771,
"narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nur": { "nur": {
"inputs": { "inputs": {
"flake-parts": [ "flake-parts": [
@ -412,6 +455,7 @@
"nix-flatpak": "nix-flatpak", "nix-flatpak": "nix-flatpak",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixvim": "nixvim",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"quickshell": "quickshell", "quickshell": "quickshell",
"stylix": "stylix", "stylix": "stylix",
@ -425,13 +469,13 @@
"base16-helix": "base16-helix", "base16-helix": "base16-helix",
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme", "firefox-gnome-theme": "firefox-gnome-theme",
"flake-parts": "flake-parts", "flake-parts": "flake-parts_2",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"nur": "nur", "nur": "nur",
"systems": "systems", "systems": "systems_2",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
@ -468,6 +512,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@ -32,10 +32,15 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak.url = "github:gmodena/nix-flatpak"; nix-flatpak.url = "github:gmodena/nix-flatpak";
grub2-themes.url = "github:vinceliuice/grub2-themes"; grub2-themes.url = "github:vinceliuice/grub2-themes";
}; };
outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nixos-hardware, stylix, niri, zen-browser, grub2-themes, nix-flatpak, ... }: outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nixos-hardware, stylix, niri, zen-browser, grub2-themes, nix-flatpak, ... }:
let let

View File

@ -22,7 +22,7 @@
./firefox.nix ./firefox.nix
./boot-splash.nix ./boot-splash.nix
./zsh.nix ./zsh.nix
./neovim.nix ./neovim
./packages ./packages
]; ];

View File

@ -1,95 +0,0 @@
{ config, lib, pkgs, ... }:
{
programs.neovim = {
enable = true;
# ...
extraPackages = with pkgs.vimPlugins; [
lazy-nvim
LazyVim
bufferline-nvim
# stylua
# ripgrep
];
extraLuaConfig =
let
plugins = with pkgs.vimPlugins; [
LazyVim
bufferline-nvim
cmp-buffer
cmp-nvim-lsp
cmp-path
cmp_luasnip
conform-nvim
dashboard-nvim
dressing-nvim
flash-nvim
friendly-snippets
gitsigns-nvim
indent-blankline-nvim
lualine-nvim
neo-tree-nvim
neoconf-nvim
neodev-nvim
noice-nvim
nui-nvim
nvim-cmp
nvim-lint
nvim-lspconfig
nvim-notify
nvim-spectre
nvim-treesitter
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-ts-autotag
nvim-ts-context-commentstring
nvim-web-devicons
persistence-nvim
plenary-nvim
telescope-fzf-native-nvim
telescope-nvim
todo-comments-nvim
tokyonight-nvim
trouble-nvim
vim-illuminate
vim-startuptime
which-key-nvim
{ name = "LuaSnip"; path = luasnip; }
{ name = "catppuccin"; path = catppuccin-nvim; }
];
mkEntryFromDrv = drv:
if lib.isDerivation drv then { name = "${lib.getName drv}"; path = drv; }
else drv;
lazyPath = pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins);
in
''
vim.opt.clipboard = "unnamedplus"
vim.opt.shiftwidth = 2
vim.opt.mousescroll = "ver:0,hor:0"
vim.opt.rtp:prepend("${pkgs.vimPlugins.lazy-nvim}")
require("lazy").setup({
defaults = { lazy = true },
dev = {
path = "${lazyPath}",
patterns = { "" },
fallback = true,
},
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = true },
{ "mason-org/mason-lspconfig.nvim", enabled = false },
{ "mason-org/mason.nvim", enabled = false },
--{ import = "plugins" },
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } },
},
})
'';
};
}

View File

@ -10,7 +10,7 @@
]; ];
home-manager.sharedModules = [ home-manager.sharedModules = [
./neovim-home.nix ./home.nix
]; ];

122
modules/neovim/home.nix Normal file
View File

@ -0,0 +1,122 @@
{ inputs, config, lib, pkgs, ... }:
{
imports = [
inputs.nixvim.homeModules.nixvim
];
programs.nixvim = {
enable = true;
waylandSupport = true;
# Basic options
opts = {
autoindent = true;
clipboard = "unnamedplus";
shiftwidth = 2;
mousescroll = "ver:0,hor:0";
expandtab = true; # Always insert spaces, never hard tab characters
tabstop = 2; # Make hard tabs display as 2 columns (matches shiftwidth)
softtabstop = 2; # Backspace deletes 2 spaces at a time
number = true;
relativenumber = true;
cursorline = true; # Highlights the entire current line
cursorlineopt = "both"; # Highlights both the line AND the line number
termguicolors = true;
};
colorschemes.catppuccin = {
enable = true;
settings = {
flavour = "mocha";
term_colors = true;
styles = {
booleans = [ "bold" "italic" ];
conditionals = [ "bold" ];
functions = [ "bold" ];
keywords = [ "italic" ];
};
};
};
keymaps = [
{
mode = "v";
key = ">";
action = ">gv";
options.desc = "Indent and keep selection";
}
{
mode = "v";
key = "<";
action = "<gv";
options.desc = "Unindent and keep selection";
}
];
plugins = {
# Statusline at the bottom of the screen
lualine.enable = true;
# Tab bar at the top of the screen
bufferline.enable = true;
# File type icons used by many UI plugins (Dependency)
web-devicons.enable = true;
# Replaces the default cmdline, messages, and popupmenu with a nicer UI
noice.enable = true;
# Popup notification manager
notify.enable = true;
treesitter = {
# Syntax parsing for accurate highlighting and code understanding
enable = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
};
# Shows the current function/class context pinned at the top of the buffer
treesitter-context.enable = true;
# Text objects based on treesitter nodes (e.g. select a function body)
treesitter-textobjects.enable = true;
# Auto-closes and renames HTML/JSX tags using treesitter
ts-autotag.enable = true;
# Adds indentation guide lines to every indent level
indent-blankline = {
enable = true;
settings = {
indent = {
char = "";
tab_char = ""; # Explicitly define the tab indent guide character
};
scope = {
enabled = true;
};
whitespace = {
remove_blankline_trail = false;
};
};
};
# Highlights and searches TODO/FIXME/HACK comments
todo-comments.enable = true;
nvim-autopairs = {
enable = true;
settings = {
check_ts = true; # Use treesitter to avoid pairing inside strings/comments
};
};
};
extraPlugins = with pkgs.vimPlugins; [
];
# Additional Lua configuration
extraConfigLua = ''
-- Custom Lua config here
vim.opt.cpoptions:append('I')
'';
};
}