Installation process fails to move/link/copy files to /nix/store/*

New user, so bear with me. If this is the wrong category, please move the post.

I decided to start with Nix using someone elses’ code so I could read working examples and learn along the way. Specifically this config.

I installed it as is and then started making modifications and removing bits I don’t need - no problems so far. Rebuilding it still worked fine. Once I was done I wanted to see if I could replace the users + hosts with my own. To do this I used vscode to replace all entries of the user with my own, and then renamed all related files accordingly. It seems to me this should not have caused much issue, however, when attempting a clean install (wiped the drive) with these files (and using the new host reference in the install command) the install spits out:

error: getting status of '/mnt/nix/store/9x4is1nnnr9d4g200l25zfqd2226mngp-source/hosts/main': No such file or directory

I’m not sure how the NixOS installation process works, but it seems like it doesn’t copy/link the files in /mnt/etc/nixos which is where hosts/main etc exists. If I were to copy it manually, the installer will proceed, until it runs into the next file/folder that does not exist in /nix/store/*.

What could I have missed, which could cause this?

/nix/store should be populated by nix. You should never manually modify anything in there.

What are your exact installation steps?

After remaining did you also git add the results?

The configuration is based on flakes, and flakes require that everything is in git properly.

1 Like