From ee5687154fcb3b4ec9fb47ea74924c9ad5aa199c Mon Sep 17 00:00:00 2001 From: carschandler <92899389+carschandler@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:05:05 -0500 Subject: [PATCH] neovim: add `extraPrefixedPackages` option `extraPackages` is nice to have, but there are scenarios where a package can already exist in `PATH` before it is wrapped in, so the `--suffix` option that `extraPackages` uses will have no effect. It used to use `--prefix`, and I'd like to bring back the option to choose that. --- modules/programs/neovim.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index fad05c1c..518c1731 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -65,8 +65,10 @@ let luaPackages = cfg.finalPackage.unwrapped.lua.pkgs; resolvedExtraLuaPackages = cfg.extraLuaPackages luaPackages; - extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ]) - ''--suffix PATH : "${lib.makeBinPath cfg.extraPackages}"''; + extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ]) '' + --suffix PATH : "${lib.makeBinPath cfg.extraPackages}" + --prefix PATH : "${lib.makeBinPath cfg.extraPrefixedPackages}" + ''; extraMakeWrapperLuaCArgs = lib.optionalString (resolvedExtraLuaPackages != [ ]) '' --suffix LUA_CPATH ";" "${ @@ -298,7 +300,18 @@ in { type = with types; listOf package; default = [ ]; example = literalExpression "[ pkgs.shfmt ]"; - description = "Extra packages available to nvim."; + description = "Extra packages available to {command}`nvim`."; + }; + + extraPrefixedPackages = mkOption { + type = with types; listOf package; + default = [ ]; + example = literalExpression "[ pkgs.gcc ]"; + description = '' + Extra packages available to {command}`nvim`. Packages are *prepended* + to the {env}`PATH` environment variable, whereas packages in + `extraPackages` are *appended*. + ''; }; plugins = mkOption {