From 2a4ab0d891a59fd3a0fc09e9805aad5a8f82dfac Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 31 May 2021 19:32:21 +0200 Subject: [PATCH] programs.neovim: fix tests + swap extraConfig and pluginconfig (#2053) makes more sense to have extraConfig afterwards in case use want to override config --- modules/programs/neovim.nix | 4 ++-- tests/modules/programs/neovim/plugin-config.nix | 4 ++-- tests/modules/programs/neovim/plugin-config.vim | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 75bcbb760..dcbac2e26 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -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 != [ ]) diff --git a/tests/modules/programs/neovim/plugin-config.nix b/tests/modules/programs/neovim/plugin-config.nix index 4c96fa784..bfb9f5c7a 100644 --- a/tests/modules/programs/neovim/plugin-config.nix +++ b/tests/modules/programs/neovim/plugin-config.nix @@ -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}" ''; }; diff --git a/tests/modules/programs/neovim/plugin-config.vim b/tests/modules/programs/neovim/plugin-config.vim index f16bb3f85..60b5d3c76 100644 --- a/tests/modules/programs/neovim/plugin-config.vim +++ b/tests/modules/programs/neovim/plugin-config.vim @@ -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