mirror of
https://github.com/nix-community/home-manager
synced 2024-12-12 04:49:50 +01:00
abfb4cde51
* neovim: allow setting init.vim config alongside plugins * neovim: add test for neovim plugins * neovim: make pluginWithConfigType a have type submodule
37 lines
927 B
Nix
37 lines
927 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
programs.neovim = {
|
|
enable = true;
|
|
extraConfig = ''
|
|
" This should be present in vimrc
|
|
'';
|
|
plugins = with pkgs.vimPlugins; [
|
|
vim-nix
|
|
{
|
|
plugin = vim-commentary;
|
|
config = ''
|
|
" This should be present too
|
|
autocmd FileType c setlocal commentstring=//\ %s
|
|
autocmd FileType c setlocal comments=://
|
|
'';
|
|
}
|
|
];
|
|
};
|
|
|
|
nmt.script = ''
|
|
vimrc=$(grep -Po "(?<=-u )[^ ]*" < "${
|
|
builtins.toJSON config.programs.neovim.finalPackage
|
|
}/bin/nvim")
|
|
# We need to remove the unkown store paths in the config
|
|
TESTED="" assertFileContent \
|
|
<( ${pkgs.perl}/bin/perl -pe "s|\Q$NIX_STORE\E/[a-z0-9]{32}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" < "$vimrc"
|
|
) \
|
|
"${./plugin-config.vim}"
|
|
'';
|
|
};
|
|
}
|
|
|