Installing Nix on Ubuntu 21.10 doesn't seem to work correctly

The steps I followed:

  1. Ran sh <(curl -L --daemon (as the download page instructed)
  2. Exited the shell
  3. Opened a new shell, and ran nix-shell -p nix-info --run "nix-info -m" (as the installer output instructed)
  4. Was greeted with “Command ‘nix-shell’ not found, but can be installed with: sudo apt install nix-bin”
  5. Rebooted computer, repeated step 3
  6. Received same output as step 4.

I assumed the issue is that nix-shell is not ending up on my PATH, so I re-ran the installer to see if I could tell from the output which file it was changing the PATH variable in. When I did that, the installer failed. I pasted the output here: NixFailure.txt · GitHub

Seems it modifies /etc/bashrc or /etc/zshrc nowadays (used to ask you to add something to your user rc files iirc): Installing a Binary Distribution

My guess is the installation should have stopped because nix had already been installed, but the heuristic failed, and because the daemon had already started the binaries were in use and couldn’t be replaced later on in the installation, resulting in that failure.