Complete newb here…
The examples I’m finding advocate git for version control of /etc/nixos, along with home profile configuration using home-manager, with the associated configs living in something like /etc/nixos/home-manager/home.nix.
So having run nixos-rebuild switch as root, to update my home profile I should then switch to my user before running home-manager switch --flake .#mike@hostname, however with the directory under version control, and obviously owned by root, this yields the error:
error:
… while fetching the input 'git+file:///etc/nixos'
error: opening Git repository '"/etc/nixos"': repository path '/etc/nixos/' is not owned by current user
The error can be suppressed by running mv .git .gitbak before switching, but I feel I must be missing something.
So, how should I be switching home-manager profiles under version control owned by root? I understand the default config location is ~/.config/home-manager, but I want to keep this all under /etc/nixos, which is what all the examples I see are doing…