Does not seem to work with Arch provided `nix`
Opened this issue · 8 comments
Steps to reproduce:
sudo pacman -S nix
sh <(curl --proto '=https' --tlsv1.2 -sSf https://garn.io/install.sh)
which the fails with
NIX INSTALLATION
================
Hooray, nix is already installed:
nix (Nix) 2.18.1
BINARY CACHE CONFIGURATION
==========================
For 'garn' to work well, nix needs to use the garnix.io binary
cache. But the cache configuration cannot be found. This
installer will modify /etc/nix/nix.conf to add the garnix.io binary cache.
Should I add the garnix.io binary cache to /etc/nix/nix.conf now (requires sudo)? [y/n] y
[sudo] password for sol:
trying to restart the nix-daemon...
The garnix cache is now configured.
installing 'garn'...
error: getting status of /nix/var/nix/daemon-socket/socket: Permission denied
Turns out that the mistake was on my part.
sudo gpasswd -a $(whoami) nix-users
I was mislead by the fact that I just authorized sudo
, so I didn't immediately realize that this is run with user privileges.
It still eventually fails with:
NIX INSTALLATION
================
Hooray, nix is already installed:
nix (Nix) 2.18.1
BINARY CACHE CONFIGURATION
==========================
For 'garn' to work well, nix needs to use the garnix.io binary
cache. But the cache configuration cannot be found. This
installer will modify /etc/nix/nix.conf to add the garnix.io binary cache.
Should I add the garnix.io binary cache to /etc/nix/nix.conf now (requires sudo)? [y/n] y
[sudo] password for sol:
trying to restart the nix-daemon...
The garnix cache is now configured.
installing 'garn'...
error: creating symlink from '/nix/var/nix/profiles/default-1-link.tmp-12768-1986651841' to '/nix/store/2kpfszzh6f423d2yv7p480hg6bwyq141-profile': Permission denied
Running
/nix/store/2kpfszzh6f423d2yv7p480hg6bwyq141-profile/bin/garn enter frontend
with the first example from the tutorial works though.
Hm. Is there a ~/.nix-profile
? What does it point to? And are there any directories under /nix/var/nix/profiles/per-user
?
$ ls -al ~/.nix-profile /nix/var/nix/profiles/per-user/
lrwxrwxrwx 1 sol sol 29 Mar 23 2014 /home/sol/.nix-profile -> /nix/var/nix/profiles/default
/nix/var/nix/profiles/per-user/:
total 0
drwxr-xr-x 1 root root 0 Nov 3 18:04 .
drwxr-xr-x 1 root root 16 Nov 3 18:04 ..
Apparently ~/.nix-profile
has been there for a long time.
From what I understand, the Arch provided nix
package itself is to blame. I may look into it again, but AFK for today.
Looks like the command that failed in the install script is this one:
Line 115 in 53e4f97
It's using the nix profile
subcommand to install garn
. So does something like this work on your machine?
nix --extra-experimental-features 'nix-command flakes' profile install -L github:nixos/nixpkgs#hello
$ nix --extra-experimental-features 'nix-command flakes' profile install -L github:nixos/nixpkgs#hello
error: creating symlink from '/nix/var/nix/profiles/default-1-link.tmp-98292-1663647485' to '/nix/store/77pxrl8c52i7fc0khwbrs3ylla7vgrvj-profile': Permission denied
$ /nix/store/77pxrl8c52i7fc0khwbrs3ylla7vgrvj-profile/bin/hello
Hello, world!
Same result, the nix store is populated but symlinking fails.