mirror of
https://github.com/nix-community/home-manager
synced 2024-12-19 08:19:48 +01:00
8e0c1c55fb
* neovim: write config in $XDG_CONFIG_HOME/init.vim instead of wrapping the configuration, which has sideeffects https://github.com/NixOS/nixpkgs/issues/55376 * fix: update test accordingly
36 lines
914 B
Nix
36 lines
914 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="$TESTED/home-files/.config/nvim/init.vim"
|
|
assertFileExists home-files/.config/nvim/init.vim
|
|
# 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}"
|
|
'';
|
|
};
|
|
}
|
|
|