Error: opening lock file '/nix/var/nix/profiles/per-user/arya/profile.lock': Permission denied

This seems a little different than some other similar tickets.

This is after a multi-user macOS install:

% nix-env -iA cachix -f https://cachix.org/api/v1/install        
installing 'cachix-1.5'
error: opening lock file '/nix/var/nix/profiles/per-user/arya/profile.lock': Permission denied
% ls -ld /nix/var/nix/profiles/per-user/arya/
drwxr-xr-x 2 root nixbld 64 Feb  2 11:10 /nix/var/nix/profiles/per-user/arya/

I didn’t find anything searching, and I didn’t hear back on Discord, so I came here.

1 Like

What version of nix?

If this is a 2.14/2.15, please try again with 2.16 and 2.13 (in order) and report back if and which fixes the issue.