Skip to content

Commit

Permalink
Merge pull request #7218 from Gabriella439/headless
Browse files Browse the repository at this point in the history
Add `--yes` option for Nix installation script
  • Loading branch information
edolstra authored Nov 3, 2022
2 parents dd1970c + a71e317 commit 499e99d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/install-multi-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ readonly EXTRACTED_NIX_PATH="$(dirname "$0")"

readonly ROOT_HOME=~root

if [ -t 0 ]; then
if [ -t 0 ] && [ -z "${NIX_INSTALLER_YES:-}" ]; then
readonly IS_HEADLESS='no'
else
readonly IS_HEADLESS='yes'
Expand Down
6 changes: 5 additions & 1 deletion scripts/install-nix-from-closure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ while [ $# -gt 0 ]; do
# # intentional tail space
# ACTIONS="${ACTIONS}uninstall "
# ;;
--yes)
export NIX_INSTALLER_YES=1;;
--no-channel-add)
export NIX_INSTALLER_NO_CHANNEL_ADD=1;;
--daemon-user-count)
Expand All @@ -90,7 +92,7 @@ while [ $# -gt 0 ]; do
shift;;
*)
{
echo "Nix Installer [--daemon|--no-daemon] [--daemon-user-count INT] [--no-channel-add] [--no-modify-profile] [--nix-extra-conf-file FILE]"
echo "Nix Installer [--daemon|--no-daemon] [--daemon-user-count INT] [--yes] [--no-channel-add] [--no-modify-profile] [--nix-extra-conf-file FILE]"

echo "Choose installation method."
echo ""
Expand All @@ -104,6 +106,8 @@ while [ $# -gt 0 ]; do
echo " trivial to uninstall."
echo " (default)"
echo ""
echo " --yes: Run the script non-interactively, accepting all prompts."
echo ""
echo " --no-channel-add: Don't add any channels. nixpkgs-unstable is installed by default."
echo ""
echo " --no-modify-profile: Don't modify the user profile to automatically load nix."
Expand Down

0 comments on commit 499e99d

Please sign in to comment.