Flakes currently copy files to Nix store before evaluating them (notice that the error happens in /nix/store/…-source/home-manager/home.nix). In git repositories, only files that git is aware of are copied though so you will need to ensure that. No need to go all in and commit the file or even just stage it with git add, registering it with git add --intent-to-add home-manager/xdg-config.nix will be sufficient.