Failed to start Home Manager environment for <USER>

Hi everyone I use nixos btw. This morning I run my flakes for home config and when I run:

sudo nixos-rebuild switch --flake .

in ~/Flake

Ok, after this error i search a solution. I found this:

sudo -u barroco nix-env -iE ‘p: {}’

Not effect for the result.

Sorry for the lack of information, I can’t access my hyprland anymore because the super key is brick since I ran sudo nixos-rebuild switch --flake .

Yeah, this is a bug in home-manager - it’s trying to tell you that there is a file that already exists that it would need to overwrite and it’s chickening out because it doesn’t want you to lose data.

However, only the last few log lines are shown in the nixos-rebuild output, which cuts off the crucial information of which file is already present.

Run journalctl -xe --unit home-manager-savian to see what file it is.

99% of the time IME it’s the mime associations, because for whatever reason some applications think it’s appropriate to delete the symlink and replace it with a normal file with new associations. Usually stuff from Windows land where symlinks don’t exist, so I assume something in wine manages writing to symlinks that way to prevent some issue.

If it’s that you can just delete the file and rerun the switch, home-manager should then recreate the file. Then you should make the associations permanent to prevent wine from doing this again.

If it’s not that, well, decide based on which file was edited.

Keep in mind that you can always roll back your system by interrupting the boot loader and picking an old generation.

It’s work, thanks !!!