1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-10 18:57:22 +00:00
home-manager/tests/modules/programs/neovim/runtime.nix
Robert Helgesson 7a3f0b3b8d
tests: rework derivation stubbing
Instead of having to manually stub packages that should not be
downloaded we instead automatically stub all packages (except a small
list of whitelisted ones). Tests can re-introduce the real package by
using the `realPkgs` module argument.
2025-02-04 23:58:20 +01:00

51 lines
1.3 KiB
Nix

{ config, lib, pkgs, realPkgs, ... }:
lib.mkIf config.test.enableBig {
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=://
'';
};
}
];
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}"
];
}
{
extraPython3Packages = ps: with ps; [ jedi pynvim ];
extraLuaPackages = ps: with ps; [ luacheck ];
}
{
extraPython3Packages = with pkgs.python3Packages; [ jedi pynvim ];
extraLuaPackages = with pkgs.lua51Packages; [ luacheck ];
}
];
_module.args.pkgs = lib.mkForce realPkgs;
nmt.script = ''
ftplugin="home-files/.config/nvim/after/ftplugin/c.vim"
nvimbin="home-path/bin/nvim"
assertFileExists "$ftplugin"
assertFileRegex "$nvimbin" 'LIBRARY_PATH'
assertFileRegex "$nvimbin" 'PKG_CONFIG_PATH'
'';
}