diff --git a/flake.lock b/flake.lock index 5159d0a..5e484e2 100644 --- a/flake.lock +++ b/flake.lock @@ -18,7 +18,6 @@ "devshell": { "inputs": { "nixpkgs": [ - "jeezyvim", "nixvim", "nixpkgs" ] @@ -38,33 +37,33 @@ } }, "flake-compat": { + "flake": false, "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" } }, "flake-compat_2": { - "flake": false, "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, "flake-parts": { @@ -88,27 +87,8 @@ } }, "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_3": { "inputs": { "nixpkgs-lib": [ - "jeezyvim", "nixvim", "nixpkgs" ] @@ -127,9 +107,9 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_3": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { "lastModified": 1730504689, @@ -150,11 +130,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -168,11 +148,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -186,11 +166,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -202,28 +182,25 @@ "git-hooks": { "inputs": { "flake-compat": [ - "jeezyvim", "nixvim", "flake-compat" ], "gitignore": "gitignore", "nixpkgs": [ - "jeezyvim", "nixvim", "nixpkgs" ], "nixpkgs-stable": [ - "jeezyvim", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1730814269, - "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "d70155fdc00df4628446352fc58adc640cd705c2", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", "type": "github" }, "original": { @@ -235,7 +212,6 @@ "gitignore": { "inputs": { "nixpkgs": [ - "jeezyvim", "nixvim", "git-hooks", "nixpkgs" @@ -279,17 +255,16 @@ "home-manager_2": { "inputs": { "nixpkgs": [ - "jeezyvim", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1731235328, - "narHash": "sha256-NjavpgE9/bMe/ABvZpyHIUeYF1mqR5lhaep3wB79ucs=", + "lastModified": 1731887066, + "narHash": "sha256-uw7K/RsYioJicV79Nl39yjtfhdfTDU2aRxnBgvFhkZ8=", "owner": "nix-community", "repo": "home-manager", - "rev": "60bb110917844d354f3c18e05450606a435d2d10", + "rev": "f3a2ff69586f3a54b461526e5702b1a2f81e740a", "type": "github" }, "original": { @@ -301,13 +276,11 @@ "ixx": { "inputs": { "flake-utils": [ - "jeezyvim", "nixvim", "nuschtosSearch", "flake-utils" ], "nixpkgs": [ - "jeezyvim", "nixvim", "nuschtosSearch", "nixpkgs" @@ -328,31 +301,9 @@ "type": "github" } }, - "jeezyvim": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": [ - "nixpkgs" - ], - "nixvim": "nixvim" - }, - "locked": { - "lastModified": 1731546580, - "narHash": "sha256-C9M90BRysaH+QI6qxTJlCKtBzUuueaOswMA129nZdOY=", - "owner": "LGUG2Z", - "repo": "JeezyVim", - "rev": "29055d46fc541938fe9d97cc579bb366170652ff", - "type": "github" - }, - "original": { - "owner": "LGUG2Z", - "repo": "JeezyVim", - "type": "github" - } - }, "krewfile": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] @@ -374,21 +325,19 @@ "nix-darwin": { "inputs": { "nixpkgs": [ - "jeezyvim", - "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1731153869, - "narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=", - "owner": "lnl7", + "lastModified": 1732016537, + "narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=", + "owner": "LnL7", "repo": "nix-darwin", - "rev": "5c74ab862c8070cbf6400128a1b56abb213656da", + "rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4", "type": "github" }, "original": { - "owner": "lnl7", + "owner": "LnL7", "repo": "nix-darwin", "type": "github" } @@ -396,27 +345,28 @@ "nix-darwin_2": { "inputs": { "nixpkgs": [ + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1732016537, - "narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=", - "owner": "LnL7", + "lastModified": 1731885500, + "narHash": "sha256-ZrztYfSOS33J+ewq5alBOSdnIyZ0/sr1iy7FyBe9zIg=", + "owner": "lnl7", "repo": "nix-darwin", - "rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4", + "rev": "c60b5c924c6188a0b3ca2e139ead3d0f92ae5db5", "type": "github" }, "original": { - "owner": "LnL7", + "owner": "lnl7", "repo": "nix-darwin", "type": "github" } }, "nixos-wsl": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -438,16 +388,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731139594, - "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", - "owner": "NixOS", + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", + "owner": "nixos", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } @@ -464,18 +414,6 @@ "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" } }, - "nixpkgs-lib_2": { - "locked": { - "lastModified": 1730504152, - "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1731890469, @@ -492,40 +430,26 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1731755305, - "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat", - "flake-parts": "flake-parts_3", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_2", "git-hooks": "git-hooks", "home-manager": "home-manager_2", - "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs", + "nix-darwin": "nix-darwin_2", + "nixpkgs": [ + "nixpkgs" + ], "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1731527733, - "narHash": "sha256-12OpSgbLDiKmxvBXwVracIfGI9FpjFyHpa1r0Ho+NFA=", + "lastModified": 1732035679, + "narHash": "sha256-J03v1XnxvsrrvHmzKVBZiwik8678IXfkH1/ZR954ujk=", "owner": "nix-community", "repo": "nixvim", - "rev": "f11a877bcc1d66cc8bd7990c704f91c1e99c7d08", + "rev": "929bb0cd1cffb9917ab14be9cdb3f27efd6f505f", "type": "github" }, "original": { @@ -536,20 +460,19 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_3", "ixx": "ixx", "nixpkgs": [ - "jeezyvim", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1731060242, - "narHash": "sha256-43yLsOm/wxBbfYSNDWVJeVv5Ij+23X3BIjFUfsdx/6M=", + "lastModified": 1731936508, + "narHash": "sha256-z0BSSf78LkxIrrFXZYmCoRRAxAmxMUKpK7CyxQRvkZI=", "owner": "NuschtOS", "repo": "search", - "rev": "ef493352f9e1f051e01a55c062731503a6b36b4e", + "rev": "fe07070f811b717a4626d01fab714a87d422a9e1", "type": "github" }, "original": { @@ -563,12 +486,12 @@ "catppuccin": "catppuccin", "flake-parts": "flake-parts", "home-manager": "home-manager", - "jeezyvim": "jeezyvim", "krewfile": "krewfile", - "nix-darwin": "nix-darwin_2", + "nix-darwin": "nix-darwin", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", "rust-overlay": "rust-overlay", "sops-nix": "sops-nix", "talhelper": "talhelper" @@ -661,7 +584,7 @@ }, "talhelper": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_3", "nixpkgs": [ "nixpkgs" ] @@ -683,17 +606,16 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "jeezyvim", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1730321837, - "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", + "lastModified": 1731944360, + "narHash": "sha256-sJxPh+V0vUkBhlA58ok/y0o96AtfqiEF0O8qsdolI6o=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", + "rev": "579b9a2fd0020cd9cd81a4ef4eab2dca4d20c94c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e148508..29ab641 100644 --- a/flake.nix +++ b/flake.nix @@ -26,13 +26,6 @@ url = "github:catppuccin/nix"; }; - # JeezyVim - # https://github.com/LGUG2Z/JeezyVim - jeezyvim = { - url = "github:LGUG2Z/JeezyVim"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - # Krewfile # https://github.com/brumhard/krewfile krewfile = { @@ -53,6 +46,13 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # NixVim + # https://github.com/azuwis/lazyvim-nixvim + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Rust toolchain overlay # https://github.com/oxalica/rust-overlay rust-overlay = { diff --git a/homes/_modules/shell/nvim/default.nix b/homes/_modules/shell/nvim/default.nix index 35281b9..c9de7f6 100644 --- a/homes/_modules/shell/nvim/default.nix +++ b/homes/_modules/shell/nvim/default.nix @@ -10,25 +10,125 @@ let in { options.modules.shell.nvim = { - enable = lib.mkEnableOption "nixvim + jeezyvim"; + enable = lib.mkEnableOption "nixvim"; }; config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ - (jeezyvim.extend { - colorschemes = { - kanagawa.enable = false; - catppuccin.enable = true; - catppuccin.settings.flavour = catppuccinCfg.flavor; - }; - - viAlias = true; - vimAlias = true; - extraConfigLuaPost = lib.mkForce '' - vim.g.clipboard = ""; + # Based on https://github.com/azuwis/lazyvim-nixvim + + programs.nixvim = { + enable = true; + + viAlias = true; + vimAlias = true; + + colorschemes = { + catppuccin.enable = true; + catppuccin.settings.flavour = catppuccinCfg.flavor; + }; + + extraPackages = with pkgs; [ + # LazyVim + lua-language-server + stylua + # Telescope + ripgrep + ]; + + extraPlugins = [ pkgs.vimPlugins.lazy-nvim ]; + + extraConfigLua = + let + plugins = with pkgs.vimPlugins; [ + # LazyVim + LazyVim + bufferline-nvim + cmp-buffer + cmp-nvim-lsp + cmp-path + conform-nvim + dashboard-nvim + dressing-nvim + flash-nvim + friendly-snippets + gitsigns-nvim + grug-far-nvim + indent-blankline-nvim + lazydev-nvim + lualine-nvim + luvit-meta + neo-tree-nvim + noice-nvim + nui-nvim + nvim-cmp + nvim-lint + nvim-lspconfig + nvim-notify + nvim-snippets + nvim-treesitter + nvim-treesitter-textobjects + nvim-ts-autotag + persistence-nvim + plenary-nvim + snacks-nvim + telescope-fzf-native-nvim + telescope-nvim + todo-comments-nvim + trouble-nvim + ts-comments-nvim + which-key-nvim + { + name = "mini.ai"; + path = mini-nvim; + } + { + name = "mini.icons"; + path = mini-nvim; + } + { + name = "mini.pairs"; + path = mini-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 + '' + require("lazy").setup({ + defaults = { + lazy = true, + }, + dev = { + -- reuse files from pkgs.vimPlugins.* + path = "${lazyPath}", + patterns = { "." }, + -- fallback to download + fallback = true, + }, + spec = { + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- The following configs are needed for fixing lazyvim on nix + -- force enable telescope-fzf-native.nvim + { "nvim-telescope/telescope-fzf-native.nvim", enabled = true }, + -- disable mason.nvim, use config.extraPackages + { "williamboman/mason-lspconfig.nvim", enabled = false }, + { "williamboman/mason.nvim", enabled = false }, + -- use catppuccin colorscheme + { "LazyVim/LazyVim", opts = { colorscheme = "catppuccin" } }, + -- put this line at the end of spec to clear ensure_installed + { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) opts.ensure_installed = {} end }, + }, + }) ''; - }) - ]; + }; # Set Neovim as the default app for man pages home.sessionVariables = { diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 2e0c30f..9331952 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -37,6 +37,7 @@ in systemFunction = inputs.nix-darwin.lib.darwinSystem; modules = [ inputs.home-manager.darwinModules.home-manager + inputs.nixvim.nixDarwinModules.nixvim ../hosts/_modules/darwin ../hosts/${hostname} ]; diff --git a/lib/modules/homemanager.nix b/lib/modules/homemanager.nix index 7627374..df05f48 100644 --- a/lib/modules/homemanager.nix +++ b/lib/modules/homemanager.nix @@ -21,6 +21,7 @@ inputs.krewfile.homeManagerModules.krewfile inputs.catppuccin.homeManagerModules.catppuccin inputs.sops-nix.homeManagerModules.sops + inputs.nixvim.homeManagerModules.nixvim ]; extraSpecialArgs = { inherit inputs hostname system; diff --git a/overlays/default.nix b/overlays/default.nix index 6be8aed..afd8832 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -2,13 +2,18 @@ let overlays = system: [ inputs.rust-overlay.overlays.default - inputs.jeezyvim.overlays.default + (final: prev: { unstable = import inputs.nixpkgs-unstable { inherit (final) system; config.allowUnfree = true; }; }) + + (final: prev: { + # Packages from inputs + }) + ( final: prev: import ../pkgs {