Default to single-user install

This commit is contained in:
Graham Christensen 2018-09-01 08:51:32 -04:00
parent c3e508d924
commit 51f9682a8b
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -30,15 +30,14 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi fi
fi fi
# Determine if we should punt to the single-user installer or not # Determine if we could use the multi-user installer or not
if [ "$(uname -s)" = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
INSTALL_MODE=daemon echo "Note: a multi-user installation is possible. See https://nixos.org/nix/manual/#sect-multi-user-installation" >&2
elif [ "$(uname -s)" = "Linux" ] && [ -e /run/systemd/system ]; then elif [ "$(uname -s)" = "Linux" ] && [ -e /run/systemd/system ]; then
INSTALL_MODE=daemon echo "Note: a multi-user installation is possible. See https://nixos.org/nix/manual/#sect-multi-user-installation" >&2
else
INSTALL_MODE=no-daemon
fi fi
INSTALL_MODE=no-daemon
# Trivially handle the --daemon / --no-daemon options # Trivially handle the --daemon / --no-daemon options
if [ "x${1:-}" = "x--no-daemon" ]; then if [ "x${1:-}" = "x--no-daemon" ]; then
INSTALL_MODE=no-daemon INSTALL_MODE=no-daemon
@ -47,14 +46,18 @@ elif [ "x${1:-}" = "x--daemon" ]; then
elif [ "x${1:-}" != "x" ]; then elif [ "x${1:-}" != "x" ]; then
( (
echo "Nix Installer [--daemon|--no-daemon]" echo "Nix Installer [--daemon|--no-daemon]"
echo "Choose installation method."
echo "" echo ""
echo " --daemon: Force the installer to use the Daemon" echo " --daemon: Installs and configures a background daemon that manages the store,"
echo " based installer, even though it may not" echo " providing multi-user support and better isolation for local builds."
echo " work." echo " Both for security and reproducibility, this method is recommended if"
echo " supported on your platform."
echo " See https://nixos.org/nix/manual/#sect-multi-user-installation"
echo "" echo ""
echo " --no-daemon: Force a no-daemon, single-user" echo " --no-daemon: Simple, single-user installation that does not require root and is"
echo " installation even when the preferred" echo " trivial to uninstall."
echo " method is with the daemon." echo " (default)"
echo "" echo ""
) >&2 ) >&2
exit exit