tests/plugins: refactor (#235)

This commit is contained in:
Gaétan Lepage 2023-03-22 07:42:02 +01:00 committed by GitHub
parent 89f54be73a
commit db5061b4db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 485 additions and 744 deletions

View file

@ -1,35 +0,0 @@
{pkgs, ...}: {
checkNvim = {
name,
nvim,
dontRun,
...
}:
pkgs.stdenv.mkDerivation {
name = name;
nativeBuildInputs = [nvim pkgs.docker-client];
dontUnpack = true;
# We need to set HOME because neovim will try to create some files
#
# Because neovim does not return an exitcode when quitting we need to check if there are
# errors on stderr
buildPhase =
if !dontRun
then ''
output=$(HOME=$(realpath .) nvim -mn --headless "+q" 2>&1 >/dev/null)
if [[ -n $output ]]; then
echo "ERROR: $output"
exit 1
fi
''
else ''
'';
# If we don't do this nix is not happy
installPhase = ''
mkdir $out
'';
};
}