`nix-channel --update` error: `error: cannot open connection to remote store 'daemon': error: reading from file: Connection reset by peer`

I’m finding that I’m not able to run nix-channel --update in a Packer configuration script:

error: cannot open connection to remote store 'daemon': error: reading from file: Connection reset by peer

Why am I getting this error? AFAICT I have enough disk space.

1 Like

I get the same error on a newly created virt-manager/qemu VM when home-manager is restarted from nixos-rebuilt --target-host my-vm ... with 63G free space

Just found a workaround. I had to add a user to nix.settings.trusted-users = [ "myuser"];
I can’t tell why this was necessary because I have several machines with similar configuration where this wasn’t necessary. I usually do nix operations using the admin user or root (sudo) which are already set as trusted users.

1 Like

Encountered this issue when trying to run hydra, I had to add “hydra” to the trusted users. Thanks @zoechi.

1 Like