=> https://bugs.archlinux.org/task/46169 Download bootstrap chroot => http://quantum-mirror.hu/mirrors/pub/archlinux/iso/2021.11.01/archlinux-bootstrap-2021.11.01-x86_64.tar.gz Extract it somewhere. Final boot script. Important!!! Run with `sudo -E`. The "-E" is important. Or just hardcode the path to your home directory. ``` #!/bin/sh set -ex cd "$(dirname "$0")" mount --bind root.x86_64 root.x86_64 mount -o bind "$HOME" root.x86_64/home/user/host-home # delete these two if you are not using Guix, or modify them if you are using Nix mount -o bind,ro /gnu/store root.x86_64/gnu/store mount -o bind,ro /var/guix root.x86_64/var/guix bash root.x86_64/bin/arch-chroot root.x86_64 /bin/env -i bash -l # again, delete them umount -l root.x86_64/var/guix umount -l root.x86_64/gnu/store umount -l root.x86_64/home/user/host-home umount -l root.x86_64 ``` First time, on the host system: ``` # write down this number, it will be important echo $UID sudo mount --bind root.x86_64 root.x86_64 sudo bash root.x86_64/bin/arch-chroot root.x86_64 /bin/env -i bash -l ``` First time setup inside guest: ``` # enable some mirrors sed -i 's/^#\(.*\.hu.*\)/\1/' /etc/pacman.d/mirrorlist # set up timezone ln -s /usr/share/zoneinfo/Europe/Budapest /etc/localtime # initalize package manager pacman-key --init pacman-key --populate archlinux # install development packages pacman -Syu --needed git base-devel # optional if you are using Guix, otherwise not really: pacman -S base # (if you are using Guix or Nix, you can just mount their store and use their packages) # create store mount point mkdir -p /gnu/store mkdir -p /var/guix # create a non-root user. the UID thing is important, it lets you share your host's home directory in the guest. useradd -m -u $UID_OF_HOST_USER user # optional: ignore all security precautions and enable passwordless sudo for this user? # maybe don't do this? echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers # alternatively, add a password usermod -aG wheel user passwd user echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers # change to a login shell of the new user su -l user # create host home mount mkdir ~/host-home # install yay git clone https://aur.archlinux.org/yay.git cd yay makepkg -si # now you can install anything, like, say, Infer. yay -Sy infer # link to host guix. ignore if your host system isn't Guix. (cd ~/.config; ln -s ../host-home/.config/guix ~/.config/guix) ln -s host-home/.guix-profile ~/.guix-profile/ ```