mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
Netman tries to call 'docker -v' and it hangs neovim if the docker command is not found. This adds the docker binary to the derivation running checks
35 lines
791 B
Nix
35 lines
791 B
Nix
{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
|
|
'';
|
|
};
|
|
}
|