`sources/nixos` not found in `nix-starter-config`

@Misterio
I have a fresh NixOS installation (24.05) to get started with flakes and home-manager; I followed the instructions from Misterio77 and used the “simple version”.
Created a hardware-configuration.nix as instructed without changing anything.
Changed my username, hostname and homedir as appropriate but no additons.
Run nix flake update .
when I ran sudo nixos-rebuild switch --flake .#island I get the error:

getting status of '/nix/store/vkyw0q3hmra8qr1a5sr97brihbwxl9rp-source/nixos': No such file or directory

I had the suspicion that I should have changed the home.stateVersion from 23.05 (as in the source from Misterio77) to the current value 24.05, but the error is the same, so I changed back to 23.05.

I assume that I have an issue with some version, but being new to nixos, I do not see how to fix this. I can provide files, if necessary. Thank you for help!

Thinking off the top of my head here, have you enabled Git in the folder you’re working? If you have, did you stage the new untracked files? For some reason Nix doesn’t detect any file that’s untracked by Git if you have Git enabled in that directory.

Thank you for the confirmation that git commits play a role. I have committed all files - just checked!

On second thought: where would I have to enable git in the folder? I run NixOS and want to add flake to it and there git works.

Well, you can simply stage your untracked (new) files and that should be enough. Committing also works since you need to stage anything as a prerequisite.