diff --git a/builder/cmds/autostart.sh b/builder/cmds/autostart.sh index e465544..42dcc17 100644 --- a/builder/cmds/autostart.sh +++ b/builder/cmds/autostart.sh @@ -21,13 +21,14 @@ trap catch_errors ERR if [[ $(tty) == "/dev/tty1" ]]; then NETWORK_NEEDED=1 ./installer + # Get username from installer config for reliable error recovery + OMARCHY_USER="$(jq -r '.users[0].username' user_credentials.json)" + archinstall \ --config user_configuration.json \ --creds user_credentials.json \ --silent - OMARCHY_USER="$(ls -1 /mnt/home | head -n1)" - # No need to ask for sudo during the installation (omarchy itself responsible for removing after install) mkdir -p /mnt/etc/sudoers.d echo "root ALL=(ALL:ALL) NOPASSWD: ALL\n%wheel ALL=(ALL:ALL) NOPASSWD: ALL\n$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL" >/mnt/etc/sudoers.d/99-omarchy-installer