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.
This commit is contained in:
carschandler 2024-07-30 16:05:05 -05:00
parent 4fcd54df7c
commit ee5687154f

View file

@ -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 {