When NIXHOOKS_FILES is empty:
printf '%s\0' "${NIXHOOKS_FILES[@]}" |
{ grep -zE -- "$files_re" || true; } >"$cache_file"
printf will print an empty string, and the pattern .* will match it, running the program with an empty string argument even if always_run is false.
This patch avoids this by special casing the empty NIXHOOKS_FILES case.