Weird missing nix store when running a home manager rebuild

When I run home-manager switch --flake .#ss-rowan@rowan-nixos
I get this cryptic error messege about a missing nix store.

warning: Git tree ‘/home/ss-rowan/nixos’ is dirty
error:
… while evaluating a branch condition

     at /nix/store/w6qscasrm9g56nwgz9xv6nwcpcm2fjz8-source/lib/lists.nix:57:9:

       56|       fold' = n:
       57|         if n == len
         |         ^
       58|         then nul

   … while calling the 'length' builtin

     at /nix/store/w6qscasrm9g56nwgz9xv6nwcpcm2fjz8-source/lib/lists.nix:55:13:

       54|     let
       55|       len = length list;
         |             ^
       56|       fold' = n:

   (stack trace truncated; use '--show-trace' to show the full trace)

   error: getting status of '/nix/store/abld1d0cykcw54fv6pj54vdclz1qaamf-source/home-manager/nvim': No such file or directory

Sounds like you didn’t git add your new files. Flakes include files tracked by git. Doesn’t have to be committed or clean; just has to be tracked.

https://github.com/NixOS/nix/issues/7107