From a0dd0127d52c15186b200823e5a1c7bef5782694 Mon Sep 17 00:00:00 2001 From: Jarek <65668659+jardahrazdera@users.noreply.github.com> Date: Wed, 20 Aug 2025 16:56:35 +0200 Subject: [PATCH] Fix OMARCHY_USER when archinstall fails (#12) Get username from JSON config instead of /mnt/home to ensure error recovery works even when archinstall completely fails. --- builder/cmds/autostart.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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