2022-08-23 22:02:05 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
config = {
|
neovim: fix extraLuaPackages type. (#3533)
Assigning to `programs.neovim.extraLuaPackages` a function taking a lua package set as input
and returning a list of packages, as described in the documentation,
threw an error because the rest of the code assumed that the value was always a plain list.
Using `lib.types.coercedTo`, we can accept such functions, as per the documentation,
as well as plain lists, which we then convert to a function ignoring its input argument.
We print a warning when a plain list is assigned, since the function
form is preferred, as it ensures that the right lua package set is used.
For the lua packages, we also get the lua package set from the
finalPackage, to make sure that we are always using the same package set
as the actual unwrapped neovim package being built.
For `programs.neovim.extraPythonPackages` I did the same.
I updated the test case so that we test both ways of setting these options.
2022-12-29 01:48:45 +01:00
|
|
|
programs.neovim = lib.mkMerge [
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
plugins = with pkgs.vimPlugins; [
|
|
|
|
vim-nix
|
|
|
|
{
|
|
|
|
plugin = vim-commentary;
|
|
|
|
runtime = {
|
|
|
|
"after/ftplugin/c.vim".text = ''
|
|
|
|
" plugin-specific config
|
|
|
|
setlocal commentstring=//\ %s
|
|
|
|
setlocal comments=://
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2024-04-13 16:50:15 +02:00
|
|
|
extraWrapperArgs = let buildDeps = with pkgs; [ stdenv.cc.cc zlib ];
|
|
|
|
in [
|
|
|
|
"--suffix"
|
|
|
|
"LIBRARY_PATH"
|
|
|
|
":"
|
|
|
|
"${lib.makeLibraryPath buildDeps}"
|
|
|
|
"--suffix"
|
|
|
|
"PKG_CONFIG_PATH"
|
|
|
|
":"
|
|
|
|
"${lib.makeSearchPathOutput "dev" "lib/pkgconfig" buildDeps}"
|
|
|
|
];
|
neovim: fix extraLuaPackages type. (#3533)
Assigning to `programs.neovim.extraLuaPackages` a function taking a lua package set as input
and returning a list of packages, as described in the documentation,
threw an error because the rest of the code assumed that the value was always a plain list.
Using `lib.types.coercedTo`, we can accept such functions, as per the documentation,
as well as plain lists, which we then convert to a function ignoring its input argument.
We print a warning when a plain list is assigned, since the function
form is preferred, as it ensures that the right lua package set is used.
For the lua packages, we also get the lua package set from the
finalPackage, to make sure that we are always using the same package set
as the actual unwrapped neovim package being built.
For `programs.neovim.extraPythonPackages` I did the same.
I updated the test case so that we test both ways of setting these options.
2022-12-29 01:48:45 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
extraPython3Packages = ps: with ps; [ jedi pynvim ];
|
|
|
|
extraLuaPackages = ps: with ps; [ luacheck ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
extraPython3Packages = with pkgs.python3Packages; [ jedi pynvim ];
|
|
|
|
extraLuaPackages = with pkgs.lua51Packages; [ luacheck ];
|
|
|
|
}
|
|
|
|
];
|
2022-08-23 22:02:05 +02:00
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
ftplugin="home-files/.config/nvim/after/ftplugin/c.vim"
|
2024-04-13 16:50:15 +02:00
|
|
|
nvimbin="home-path/bin/nvim"
|
2022-08-23 22:02:05 +02:00
|
|
|
assertFileExists "$ftplugin"
|
2024-04-13 16:50:15 +02:00
|
|
|
assertFileRegex "$nvimbin" 'LIBRARY_PATH'
|
|
|
|
assertFileRegex "$nvimbin" 'PKG_CONFIG_PATH'
|
2022-08-23 22:02:05 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|