Open ToxicFrog opened 7 years ago
It looks like the cause was some .nix-foo files left in ~ from when this homedir was on NixOS. Rather than deleting/recreating them, the installer took the existing contents and had a bad time.
I marked this as stale due to inactivity. → More info
I'm also experiencing this on Debian 12 with a single-user install. With a /nix/
directory owned my me:
c$ chmod -R u+w /nix && rm -rf /nix/* && bash ./install
downloading Nix 2.18.1 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.tc9noQI8mf'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20.6M 100 20.6M 0 0 10.3M 0 0:00:01 0:00:01 --:--:-- 10.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.18.1'
building '/nix/store/hzx954rnda4k348rb4wvqbdzp9z0ynjy-user-environment.drv'...
error: opening lock file '/nix/var/nix/profiles/per-user/cjs/profile.lock': No such file or directory
/tmp/nix-binary-tarball-unpack.tc9noQI8mf/unpack/nix-2.18.1-x86_64-linux/install: unable to install Nix into your default profile
1 c$ mkdir /nix/var/nix/profiles/per-user/cjs
c$ bash ./install
downloading Nix 2.18.1 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.18.1/nix-2.18.1-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.oYLAsGnIJH'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20.6M 100 20.6M 0 0 10.6M 0 0:00:01 0:00:01 --:--:-- 10.6M
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.18.1'
unpacking channels...
modifying /home/cjs/.bash_profile...
Installation finished! To ensure that the necessary environment
variables are set, either log in again, or type
. /home/cjs/.nix-profile/etc/profile.d/nix.sh
in your shell.
Simply creating the directory and re-running seems to fix it, but that's both annoying and breaks the Devbox auto-install.
I just found another work-around: rm -rf ~/.nix-*
before running the install also fixes the issue, and let's a fresh install from an empty /nix/
work. I'm not clear on where the ~/.nix-*
files came from, but they could have been left over from a previous install of the Nix system package from Debian.