mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-03 09:36:10 +02:00
The tests can be executed using `nix flake check`, they check that modules can be built, and they execute in neovim without any errors. This commit only implements tests for tokyonight-nvim upstream defaults
36 lines
892 B
Nix
36 lines
892 B
Nix
{
|
|
makeNixvim,
|
|
pkgs,
|
|
}: let
|
|
tests = import ./plugins {inherit (pkgs) lib;};
|
|
in
|
|
# We attempt to build & execute all configurations
|
|
builtins.mapAttrs (
|
|
name: config: let
|
|
nvim = makeNixvim config;
|
|
in
|
|
pkgs.stdenv.mkDerivation {
|
|
name = name;
|
|
|
|
nativeBuildInputs = [nvim];
|
|
|
|
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 = ''
|
|
output=$(HOME=$(realpath .) nvim -mn --headless "+q" 2>&1 >/dev/null)
|
|
if [[ -n $output ]]; then
|
|
echo "ERROR: $output"
|
|
exit 1
|
|
fi
|
|
'';
|
|
|
|
# If we don't do this nix is not happy
|
|
installPhase = ''
|
|
mkdir $out
|
|
'';
|
|
}
|
|
)
|
|
tests
|