nix-community / nix-user-chroot

Install & Run nix without root permissions [maintainer=@Mic92]
MIT License
280 stars 25 forks source link

Install confusion - seems to try to hit `/nix` #118

Open jeeftor opened 5 months ago

jeeftor commented 5 months ago

Am I doing something wrong? Why is it trying to hit /nix?

I ran the following:

cargo install nix-user-chroot
mkdir -m 0755 ~/.nix
nix-user-chroot ~/.nix bash -c "curl -L https://nixos.org/nix/install | bash"

It appears its trying to install in /nix which doesn't seem correct.

nix-user-chroot ~/.nix bash -c "curl -L https://nixos.org/nix/install | bash"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4052  100  4052    0     0   4216      0 --:--:-- --:--:-- --:--:-- 2618k
downloading Nix 2.22.1 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.22.1/nix-2.22.1-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.XVfHkRCNkC'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.9M  100 21.9M    0     0  38.3M      0 --:--:-- --:--:-- --:--:-- 38.3M
Note: a multi-user installation is possible. See https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
performing a single-user installation of Nix...
copying Nix to /nix/store...

installing 'nix-2.22.1'
building '/nix/store/x8hfibkpb6as4rji91ln5xp5lnj02gn8-user-environment.drv'...
error: creating symlink from '/nix/store/z9pkb3mh7gv34q7w1zffhfw0ggm372hy-user-environment/manifest.nix' to '/nix/store/1p8ildyyfkbj6pj9rfhvf2d92nxfk7p0-env-manifest.nix': File exists
error: builder for '/nix/store/x8hfibkpb6as4rji91ln5xp5lnj02gn8-user-environment.drv' failed with exit code 1
/tmp/nix-binary-tarball-unpack.XVfHkRCNkC/unpack/nix-2.22.1-x86_64-linux/install: unable to install Nix into your default profile

And this command returns:

unshare --user --pid echo YES
YES