summaryrefslogtreecommitdiff
path: root/home-manager
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-07-31 19:46:42 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-07-31 19:46:42 -0500
commit914dfc4f066ef16a75e69f4bad304895b38a1aa5 (patch)
treecb0ccb3772ad9dea840dcaa77aff88f3e46d810e /home-manager
parent0a4ea9fbfa5a778b4ab64df8b308d557668daf3d (diff)
downloadnixos-914dfc4f066ef16a75e69f4bad304895b38a1aa5.tar.xz
nixos-914dfc4f066ef16a75e69f4bad304895b38a1aa5.zip
move neovim config to neovim-vanilla flake
Diffstat (limited to 'home-manager')
-rw-r--r--home-manager/default.nix1
-rw-r--r--home-manager/neovim.nix108
2 files changed, 0 insertions, 109 deletions
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 ];
- };
-}