I am trying to install nix as a multi-user setup.
Can I install as root?
On CentOS 7 I am not able to install as root?
I get the following error:
“Please do not run this script with root privileges. I will call sudo when I need to.”
I have a test VM that I use infrequently and want to install few applications via nix. As its infrequent I only add the root user. Hence I am not able to install nix without creating a new user. I also was not able to find any option to ‘force’ install as root.
The installer does not accept to be run as root, you could remove the checks for that, but then there will be no support for any problems you might have during and/or after the installation.
Despite how often you use or not use the machine, you really should only use an unpriviliged user for everything and use
sudo once you really need the elevated permissions.
Can you point me to the checks for root ?
I am using command “sh <(curl -L https://nixos.org/nix/install) --daemon”
That command downloads a script and pipes it to sh. I’d really like to stress that you’re entering uncharted territory.
That said, if you get rid of the
sh <() --daemon it will download the script instead, from where you can make changes how you see fit.
You will probably end up destroying this VM at some point in the process, make sure there’s nothing valuable on it.
The install script should be pretty safe to retry a few times. I still think using a VM from a clean state is a good idea to have a clean state everytime. You shouldn’t be able to permanently brick anything.