I know how to install yay:
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
What I want to do is to install it from my live USB installer.
I have indeed created my own archiso, with an installation script that installs Arch from scratch and customizes it to my liking.
However, the installation script is executed as root and root cannot call makepkg. I have created my user account on the target system using:
arch-chroot /mnt useradd -m -g users -s /bin/bash -G wheel,uucp "$user"
If I do su $user to execute makepkg, my user is not recognize as it is a target system user and not a live user.
I could create a live user and compile with it, changing the PKGDESK to /mnt/usr/bin, but I'm not sure that would work (wrt file rights).
Is there a better way to install AUR when in a live ISO?