mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 08:05:43 +02:00
output: add extraPackagesAfter option
Allow users to add packages to the end of `PATH` in the neovim wrapper. This is useful for LSP versions that might need to be overriden based on the environment, e.g. `haskell-language-server` versions provided by a project's devshell.
This commit is contained in:
parent
dce571fae5
commit
2b6f694b48
3 changed files with 23 additions and 1 deletions
|
@ -58,7 +58,14 @@ in
|
|||
extraPackages = mkOption {
|
||||
type = with types; listOf (nullOr package);
|
||||
default = [ ];
|
||||
description = "Extra packages to be made available to neovim";
|
||||
description = "Extra packages to be made available to neovim, added to the start of `PATH`";
|
||||
apply = builtins.filter (p: p != null);
|
||||
};
|
||||
|
||||
extraPackagesAfter = mkOption {
|
||||
type = with types; listOf (nullOr package);
|
||||
default = [ ];
|
||||
description = "Extra packages to be made available to neovim, added to the end of `PATH`";
|
||||
apply = builtins.filter (p: p != null);
|
||||
};
|
||||
|
||||
|
|
|
@ -241,6 +241,9 @@ in
|
|||
++ (optional (
|
||||
config.extraPackages != [ ]
|
||||
) ''--prefix PATH : "${lib.makeBinPath config.extraPackages}"'')
|
||||
++ (optional (
|
||||
config.extraPackagesAfter != [ ]
|
||||
) ''--suffix PATH : "${lib.makeBinPath config.extraPackagesAfter}"'')
|
||||
++ (optional config.wrapRc ''--add-flags -u --add-flags "${initFile}"'')
|
||||
);
|
||||
|
||||
|
|
|
@ -149,4 +149,16 @@
|
|||
end
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackagesAfter =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
extraPackagesAfter = [ pkgs.hello ];
|
||||
|
||||
extraConfigLua = ''
|
||||
if vim.fn.executable("hello") ~= 1 then
|
||||
print("Unable to find hello package.")
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue