From 914dfc4f066ef16a75e69f4bad304895b38a1aa5 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 31 Jul 2026 19:46:42 -0500 Subject: move neovim config to neovim-vanilla flake --- home-manager/default.nix | 1 - home-manager/neovim.nix | 108 ----------------------------------------------- 2 files changed, 109 deletions(-) delete mode 100644 home-manager/neovim.nix (limited to 'home-manager') diff --git a/home-manager/default.nix b/home-manager/default.nix index 8d9c722..226552a 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -6,7 +6,6 @@ ./home-cleanup.nix ./htop.nix ./mint-theme.nix - ./neovim.nix ./pcmanfm.nix ./qt-gtk-theme.nix ./theme-st.nix diff --git a/home-manager/neovim.nix b/home-manager/neovim.nix deleted file mode 100644 index 6bb13d7..0000000 --- a/home-manager/neovim.nix +++ /dev/null @@ -1,108 +0,0 @@ -{ lib, config, pkgs, ... }: let - cfg = config.programs._neovim; - - pluginDir = let - extraPlugins = cfg.plugins.packages // { - start = (cfg.plugins.packages.start or []) - ++ lib.optionals (cfg.plugins.lsp.enable && cfg.plugins.lsp.lspconfig.enable) [ cfg.plugins.lsp.lspconfig.pluginPackage ] - ++ lib.optionals cfg.plugins.treesitter.enable [ cfg.plugins.treesitter.pluginPackage ]; - }; - in pkgs.linkFarm "nvim-site" - (lib.concatLists (lib.mapAttrsToList (stage: plugins: - map (plugin: { - name = "share/nvim/site/pack/plugins/${stage}/${plugin.name}"; - path = plugin; - }) plugins - ) extraPlugins)); - - extraPackages = pkgs.symlinkJoin { - name = "nvim-extra-packages"; - paths = cfg.extraPackages - ++ lib.optionals cfg.plugins.lsp.enable cfg.plugins.lsp.languageServers.packages; - }; - - parserDir = let - allTSParserPackages = builtins.filter lib.isDerivation - (builtins.attrValues cfg.plugins.treesitter.parsers.installAllFromPackageSet); - in pkgs.symlinkJoin { - name = "nvim-treesitter-parsers"; - paths = if cfg.plugins.treesitter.parsers.installAll then allTSParserPackages else cfg.plugins.treesitter.parsers.packages; - }; - - finalPackage = pkgs.symlinkJoin { - name = "neovim-not-wrapped"; - paths = [ cfg.package ]; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/nvim \ - --prefix PATH : ${extraPackages}/bin \ - --prefix XDG_DATA_DIRS : ${pluginDir}/share \ - '' + lib.optionalString cfg.plugins.treesitter.enable '' - --add-flags '--cmd "set rtp^=${parserDir}"' \ - --add-flags '--cmd "set rtp^=${cfg.plugins.treesitter.pluginPackage}/runtime"' \ - '' + '' - # blank line here to terminate multiline command string - '' + lib.optionalString cfg.viAlias '' - ln -s $out/bin/nvim $out/bin/vi - '' + lib.optionalString cfg.vimAlias '' - ln -s $out/bin/nvim $out/bin/vim - ''; - }; -in { - options.programs._neovim = { - enable = lib.mkEnableOption "install and configure neovim"; - package = lib.mkPackageOption pkgs "neovim" {}; - viAlias = lib.mkEnableOption "alias vi => nvim"; - vimAlias = lib.mkEnableOption "alias vim => nvim"; - plugins = { - lsp = { - enable = lib.mkEnableOption "install defined language servers into nvim path"; - lspconfig = { - enable = lib.mkEnableOption "install plugin `lspconfig.pluginPackage`"; - pluginPackage = lib.mkPackageOption pkgs.vimPlugins "nvim-lspconfig" {}; - }; - languageServers.packages = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = [ ]; - description = "language server packages to add to nvim path when lsp is enabled"; - }; - }; - treesitter = { - enable = lib.mkEnableOption "install treesitter and parsers as nvim plugins"; - pluginPackage = lib.mkPackageOption pkgs.vimPlugins "nvim-treesitter" {}; - parsers.installAll = lib.mkEnableOption "install all available parsers. overrides `parsers.packages`"; - parsers.installAllFromPackageSet = lib.mkOption { - type = lib.types.attrsOf lib.types.anything; - default = pkgs.vimPlugins.nvim-treesitter-parsers; - defaultText = lib.literalExpression "pkgs.vimPlugins.nvim-treesitter-parsers"; - description = "parent package from which to install all treesitter parsers"; - }; - parsers.packages = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = [ ]; - description = "treesitter parsers to install as plugins"; - }; - }; - packages = lib.mkOption { - type = lib.types.attrsOf (lib.types.listOf lib.types.package); - default = [ ]; - example = { - start = with pkgs.vimPlugins; [ - nvim-colorizer-lua - ]; - }; - description = "extra plugins to be made available to nvim via packpath, organized by stage"; - }; - }; - extraPackages = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = [ ]; - description = "extra packages to add to nvim path"; - }; - }; - - config = lib.mkIf cfg.enable { - # NOTE: Don't use programs.neovim since that will build neovim from source - home.packages = [ finalPackage ]; - }; -} -- cgit v1.2.3