Assuming here that /dev/sda is USB stick containing arch linux installation and /dev/sdb contains our configuration scripts
mkdir /store
mount /dev/sdb1 /store
cd /store/arch_install
The script accepts "sata" and "nvme" as valid inputs
example:
sh 00_setup_scripts.sh sata
./06_pacstrap.sh
./07_pre_chroot.sh
cd
umount /store
arch-chroot /mnt
mount /dev/sdb1 /mnt
cd /mnt/arch_install
./10_post_chroot.sh
./11_install_grub.sh
passwd
./12_install_gui.sh
./13_setup_snapper.sh
exit
reboot
useradd -mG wheel herman
passwd herman
snapper -c root create —description 'Initial install, users'
pacman -S nvidia
echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf
mkdir -p /etc/pacman.d/hooks
vi /etc/pacman.d/hooks/nvidia.hook
[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux
[Action]
Description=Update Nvidia module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'
vi /etc/X11/xorg.conf.d/10-nvidia.conf
Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration"
Option "PrimaryGPU" "yes"
ModulePath "/usr/lib/nvidia/xorg"
ModulePath "/usr/lib/xorg/modules"
EndSection
vi /etc/mkinitcpio.conf
# Update line 'MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)'
mkinitcpio -p linux
snapper -c root create —description 'Initial install, users, gui, nvidia'
snapper list
snapper rollback <image number>
reboot