NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.94k stars 1.53k forks source link

Multi-user installation fails on Solus Linux distribution #4286

Open StefanSchroeder opened 4 years ago

StefanSchroeder commented 4 years ago

When following the installation instructions in the manual to perform a multi-user installation of the nix package-manager, the installation does not work as expected.

While all the files are installed correctly, the snippets for bash are not loaded, because the file /etc/bashrc does not exist.

  1. Run '$ sh <(curl -L https://nixos.org/nix/install) --daemon'
  2. Press 'n', then 'y' to confirm 'sudo'
  3. The installation proceeds and reports success.

Expected behavior

When instructed to open a new shell and to run 'nix-shell' that should do something, but it doesn't, because there is no file /etc/bashrc.

Additional context

Adding /etc/bashrc (sudo touch /etc/bashrc) will add this section to the file:

# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
  . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix

Possible solution

Either add the snippet to a new file /etc/bashrc if it does not exist or at least do not report success if none of the mechanisms to inject the loading found a suitable location to be inserted.

abathur commented 4 years ago

I believe this is covered by my unreleased fix in c40bad4. (The focus there is ZSH, but the tentative fix is touching these files if the directory exists).

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info