Why can't nixos-rebuild see files that aren't in the git repository?

There is a PR to fix that Don't ignore unstaged files in local flakes by SuperSandro2000 · Pull Request #6858 · NixOS/nix · GitHub