2023-03-03 09:18:52 +00:00
|
|
|
{pkgs, ...}: {
|
|
|
|
checkNvim = {
|
|
|
|
name,
|
|
|
|
nvim,
|
2023-03-16 09:13:43 +01:00
|
|
|
dontRun,
|
2023-03-03 09:18:52 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = name;
|
|
|
|
|
2023-03-17 13:43:17 +01:00
|
|
|
nativeBuildInputs = [nvim pkgs.docker-client];
|
2023-03-03 09:18:52 +00:00
|
|
|
|
|
|
|
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
|
2023-03-16 09:13:43 +01:00
|
|
|
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 ''
|
|
|
|
'';
|
2023-03-03 09:18:52 +00:00
|
|
|
|
|
|
|
# If we don't do this nix is not happy
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|