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

Make explicit as which user to run #9921

Open clemens-tolboom opened 10 months ago

clemens-tolboom commented 10 months ago

Platform

Additional information

Reading the https://nixos.org/download#nix-install-macos I could not make out which user I should be choose root

I expected a hint

You should run this as a normal user.

A Discord user suggest "running as root should actually fail" which did not as far as I got ... installer worked out as did

nix-shell -p nix-info --run "nix-info -m"

Output

Output ```log # running as root sh <(curl -L https://nixos.org/nix/install) -sh: syntax error near unexpected token `(' # Manually downloading and running (as root) curl -L https://nixos.org/nix/install > nixpkg_script sh ./nixpkg_script # gives the expected installer flow ```

Priorities

Add :+1: to issues you find important.

abathur commented 10 months ago

A Discord user suggest "running as root should actually fail"

They likely said this because the single-user installer will emit a warning that installing as root isn't supported. That said, it was explicitly enabled (but not "supported") in 924e19341a5ee488634bc9ce1ea9758ac496afc3 nearly a decade ago.

Not sure what others think, but I think I agree that the download page could/should suggest using a normal user with the ability to use sudo.

That text is actually in another repo:

https://github.com/NixOS/nixos-homepage/blob/9c0c43c406fb13a2822b16677fc15eb90ee2c82c/download.tt#L85-L90

Strictly speaking, this issue could probably be moved there--but I guess there may also be a gap in the Nix manual as well, so I'll stop short of recommending anyone move it (I don't have such power, myself). Might be worth opening another issue there referencing this one, though.

clemens-tolboom commented 10 months ago

I created https://github.com/NixOS/nixos-homepage/pull/1217 ... guess we can close this now?