Home-manager activation wants to acces nix profile of wrong user

Hi,

I have a nixos configuration with home-manager config for 2 modules:

  • user1
  • user2

Now, for user “user2” the home-manager activation fails with this error:

error: getting status of '/home/user1/.local/state/nix/profiles/profile': Permission denied

Not that it wants to acces the .local/state/nix/profiles/profile of the wrong user!

I believe that in a previous generation of the system (not commited, when I was setting it up), I had a misconfiguraiton, where I set the “home” of “user2” to “/home/user1”, but I am not 100% sure.

Of course I can re-setup the whole system, but I would prefer to fix the problem. But I have no Idea what could be wrong now.

Any advice on what I could do?

Thanks!

Can you share your code?