From 66ef4b89af4f0be7282c661ebef7de2c832e8a4a Mon Sep 17 00:00:00 2001 From: Cookiez Date: Thu, 19 Feb 2026 11:53:22 +0100 Subject: [PATCH] Changed Neovim to use Nixvim instead of Lazyvim. Moved Neovim into its own directory --- flake.lock | 63 ++++++++++- flake.nix | 9 +- modules/configuration.nix | 2 +- modules/neovim-home.nix | 95 ---------------- modules/{neovim.nix => neovim/default.nix} | 2 +- modules/neovim/home.nix | 122 +++++++++++++++++++++ 6 files changed, 192 insertions(+), 101 deletions(-) delete mode 100644 modules/neovim-home.nix rename modules/{neovim.nix => neovim/default.nix} (92%) create mode 100644 modules/neovim/home.nix diff --git a/flake.lock b/flake.lock index 1c1a60b..d5c7a23 100644 --- a/flake.lock +++ b/flake.lock @@ -85,6 +85,27 @@ } }, "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": { "nixpkgs-lib": [ "stylix", @@ -336,6 +357,28 @@ "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": { "inputs": { "flake-parts": [ @@ -412,6 +455,7 @@ "nix-flatpak": "nix-flatpak", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", + "nixvim": "nixvim", "plasma-manager": "plasma-manager", "quickshell": "quickshell", "stylix": "stylix", @@ -425,13 +469,13 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" ], "nur": "nur", - "systems": "systems", + "systems": "systems_2", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -468,6 +512,21 @@ "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": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index e87553f..9e6cc16 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ #stylix.url = "github:nix-community/stylix/"; stylix.url = "github:nix-community/stylix/master"; #Had to use branch or it would not build corrently stylix.inputs.nixpkgs.follows = "nixpkgs"; - + quickshell = { url = "github:outfoxxed/quickshell"; inputs.nixpkgs.follows = "nixpkgs"; @@ -32,10 +32,15 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-flatpak.url = "github:gmodena/nix-flatpak"; grub2-themes.url = "github:vinceliuice/grub2-themes"; - }; + }; outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nixos-hardware, stylix, niri, zen-browser, grub2-themes, nix-flatpak, ... }: let diff --git a/modules/configuration.nix b/modules/configuration.nix index aba24a3..44254e4 100644 --- a/modules/configuration.nix +++ b/modules/configuration.nix @@ -22,7 +22,7 @@ ./firefox.nix ./boot-splash.nix ./zsh.nix - ./neovim.nix + ./neovim ./packages ]; diff --git a/modules/neovim-home.nix b/modules/neovim-home.nix deleted file mode 100644 index 373585f..0000000 --- a/modules/neovim-home.nix +++ /dev/null @@ -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 = {} } }, - }, - }) - - ''; - }; -} diff --git a/modules/neovim.nix b/modules/neovim/default.nix similarity index 92% rename from modules/neovim.nix rename to modules/neovim/default.nix index 984ad27..08740a6 100644 --- a/modules/neovim.nix +++ b/modules/neovim/default.nix @@ -10,7 +10,7 @@ ]; home-manager.sharedModules = [ - ./neovim-home.nix + ./home.nix ]; diff --git a/modules/neovim/home.nix b/modules/neovim/home.nix new file mode 100644 index 0000000..db7d593 --- /dev/null +++ b/modules/neovim/home.nix @@ -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 = "