Try a different way
This commit is contained in:
1 parent
8ad8c948f7
commit
fdf346da39
1 file changed
+25
-28
+25
-28
@@ -1,32 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
run_install() {
|
||||
# Configurator for user information, disk selection, and wifi configuration
|
||||
./configurator
|
||||
|
||||
# Get username from installer config for reliable error recovery
|
||||
OMARCHY_USER="$(jq -r '.users[0].username' user_credentials.json)"
|
||||
|
||||
# Install using files generated by the ./configurator
|
||||
archinstall \
|
||||
--config user_configuration.json \
|
||||
--creds user_credentials.json \
|
||||
--silent
|
||||
|
||||
# No need to ask for sudo during the installation (omarchy itself responsible for removing after install)
|
||||
mkdir -p /mnt/etc/sudoers.d
|
||||
cat >/mnt/etc/sudoers.d/99-omarchy-installer <<EOF
|
||||
root ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
%wheel ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
EOF
|
||||
chmod 440 /mnt/etc/sudoers.d/99-omarchy-installer
|
||||
|
||||
# Run Omarchy web installer
|
||||
chroot_bash -lc "curl -fsSL https://omarchy.org/install | bash || bash"
|
||||
}
|
||||
|
||||
chroot_bash() {
|
||||
HOME=/home/$OMARCHY_USER \
|
||||
arch-chroot -u $OMARCHY_USER /mnt/ \
|
||||
@@ -64,7 +38,7 @@ catch_errors() {
|
||||
echo " "
|
||||
|
||||
if [[ -z ${OMARCHY_USER-} ]]; then
|
||||
echo "You can retry by running: run_install"
|
||||
echo "You can retry by running: ~/.automated_script.sh"
|
||||
else
|
||||
echo "You can retry by running: bash ~/.local/share/omarchy/install.sh || bash"
|
||||
chroot_bash
|
||||
@@ -74,5 +48,28 @@ catch_errors() {
|
||||
trap catch_errors ERR
|
||||
|
||||
if [[ $(tty) == "/dev/tty1" ]]; then
|
||||
run_install
|
||||
# Configurator for user information, disk selection, and wifi configuration
|
||||
./configurator
|
||||
|
||||
# Get username from installer config for reliable error recovery
|
||||
OMARCHY_USER="$(jq -r '.users[0].username' user_credentials.json)"
|
||||
|
||||
# Install using files generated by the ./configurator
|
||||
archinstall \
|
||||
--config user_configuration.json \
|
||||
--creds user_credentials.json \
|
||||
--silent
|
||||
|
||||
# No need to ask for sudo during the installation (omarchy itself responsible for removing after install)
|
||||
mkdir -p /mnt/etc/sudoers.d
|
||||
cat >/mnt/etc/sudoers.d/99-omarchy-installer <<EOF
|
||||
root ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
%wheel ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
EOF
|
||||
chmod 440 /mnt/etc/sudoers.d/99-omarchy-installer
|
||||
|
||||
# Run Omarchy web installer
|
||||
OMARCHY_INSTALL_URL=$(cat omarchy_installer_url.txt 2>/dev/null || echo "https://omarchy.org/install")
|
||||
chroot_bash -lc "curl -fsSL $OMARCHY_INSTALL_URL | bash || bash"
|
||||
fi
|
||||
Reference in new issue
Block a user