mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Expose installer configuration environment variables via command line flags
This commit is contained in:
parent
46be11b762
commit
9e12b2f5b8
1 changed files with 36 additions and 23 deletions
|
@ -40,14 +40,20 @@ elif [ "$(uname -s)" = "Linux" ] && [ -e /run/systemd/system ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INSTALL_MODE=no-daemon
|
INSTALL_MODE=no-daemon
|
||||||
# Trivially handle the --daemon / --no-daemon options
|
|
||||||
|
# handle the command line flags
|
||||||
|
while [ "x${1:-}" != "x" ]; do
|
||||||
if [ "x${1:-}" = "x--no-daemon" ]; then
|
if [ "x${1:-}" = "x--no-daemon" ]; then
|
||||||
INSTALL_MODE=no-daemon
|
INSTALL_MODE=no-daemon
|
||||||
elif [ "x${1:-}" = "x--daemon" ]; then
|
elif [ "x${1:-}" = "x--daemon" ]; then
|
||||||
INSTALL_MODE=daemon
|
INSTALL_MODE=daemon
|
||||||
|
elif [ "x${1:-}" = "x--no-channel-add" ]; then
|
||||||
|
NIX_INSTALLER_NO_CHANNEL_ADD=1
|
||||||
|
elif [ "x${1:-}" = "x--no-modify-profile" ]; then
|
||||||
|
NIX_INSTALLER_NO_MODIFY_PROFILE=1
|
||||||
elif [ "x${1:-}" != "x" ]; then
|
elif [ "x${1:-}" != "x" ]; then
|
||||||
(
|
(
|
||||||
echo "Nix Installer [--daemon|--no-daemon]"
|
echo "Nix Installer [--daemon|--no-daemon] [--no-channel-add] [--no-modify-profile]"
|
||||||
|
|
||||||
echo "Choose installation method."
|
echo "Choose installation method."
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -61,9 +67,16 @@ elif [ "x${1:-}" != "x" ]; then
|
||||||
echo " trivial to uninstall."
|
echo " trivial to uninstall."
|
||||||
echo " (default)"
|
echo " (default)"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo " --no-channel-add: Don't add any channels. nixpkgs-unstable is installed by default."
|
||||||
|
echo ""
|
||||||
|
echo " --no-modify-profile: Skip channel installation. When not provided nixpkgs-unstable"
|
||||||
|
echo " is installed by default."
|
||||||
|
echo ""
|
||||||
) >&2
|
) >&2
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$INSTALL_MODE" = "daemon" ]; then
|
if [ "$INSTALL_MODE" = "daemon" ]; then
|
||||||
printf '\e[1;31mSwitching to the Daemon-based Installer\e[0m\n'
|
printf '\e[1;31mSwitching to the Daemon-based Installer\e[0m\n'
|
||||||
|
|
Loading…
Reference in a new issue