fix: Respect nvim user config option

This commit is contained in:
UGA Innovation Factory
2025-12-16 13:47:50 -05:00
committed by Hunter Halloran
parent 1c71bf099e
commit 3b0c147b3f
8 changed files with 321 additions and 159 deletions

View File

@@ -73,7 +73,7 @@ in
zsh
git
oh-my-posh
inputs.lazyvim-nixvim.packages.${stdenv.hostPlatform.system}.nvim
# inputs.lazyvim-nixvim.packages.${stdenv.hostPlatform.system}.nvim
inputs.agenix.packages.${stdenv.hostPlatform.system}.default
];
}

View File

@@ -1,4 +1,19 @@
{ pkgs, ... }:
{ user }:
{
pkgs,
lib,
inputs,
...
}:
let
nvimPackages =
if user.useNvimPlugins then
[
inputs.lazyvim-nixvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
]
else
[ pkgs.neovim ];
in
{
# ============================================================================
# Neovim Configuration
@@ -6,8 +21,10 @@
# This module configures Neovim, specifically setting up TreeSitter parsers
# to ensure syntax highlighting works correctly.
home.packages = nvimPackages;
# https://github.com/nvim-treesitter/nvim-treesitter#i-get-query-error-invalid-node-type-at-position
xdg.configFile."nvim/parser".source =
xdg.configFile."nvim/parser".source = lib.mkIf user.useNvimPlugins (
let
parsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
@@ -20,5 +37,6 @@
)).dependencies;
};
in
"${parsers}/parser";
"${parsers}/parser"
);
}