Skip to content

Commit

Permalink
programs.neovim: fix tests + swap extraConfig and pluginconfig (#2053)
Browse files Browse the repository at this point in the history
makes more sense to have extraConfig afterwards in case use want to override config
  • Loading branch information
teto authored May 31, 2021
1 parent 9e253a8 commit 2a4ab0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/programs/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ let
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
cfg.plugins);
};
customRC = cfg.extraConfig
+ pkgs.lib.concatMapStrings pluginConfig cfg.plugins;
customRC = pkgs.lib.concatMapStrings pluginConfig cfg.plugins
+ cfg.extraConfig;
};

extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/programs/neovim/plugin-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ with lib;

nmt.script = ''
vimrc="$TESTED/home-files/.config/nvim/init.vim"
${pkgs.perl}/bin/perl -pe "s|\Q$NIX_STORE\E/[a-z0-9]{32}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" < "$vimrc" > $out/generated.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"
) \
$out/generated.vim \
"${./plugin-config.vim}"
'';
};
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/programs/neovim/plugin-config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set nocompatible
set packpath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir
set runtimepath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir

" This should be present in vimrc
" vim-commentary {{{
" This should be present too
autocmd FileType c setlocal commentstring=//\ %s
autocmd FileType c setlocal comments=://

" }}}
" This should be present in vimrc

0 comments on commit 2a4ab0d

Please sign in to comment.