diff --git a/arch-install.sh b/arch-install.sh new file mode 100755 index 0000000..ec4c3d8 --- /dev/null +++ b/arch-install.sh @@ -0,0 +1,153 @@ +#!/bin/bash +set -euo pipefail + +username=kk + +core_packages=( + tmux + kakoune + man-db + man-pages + clang + make + tcc + ripgrep + curl + plocate + fzf + gdb + which +) + +network_packages=( + openssh + sshfs +) + +desktop_packages=( + sway + swayidle + swaybg + swaylock + foot + wmenu + polkit # this is needed to fix swayidle not being to suspend because it doesn't have the authority, systemd-logind asks it for policy + xorg-xwayland + wl-clipboard + xdg-desktop-portal-wlr + xdg-user-dirs + xdg-utils + grim +) + +media_packages=( + pipewire + pipewire-pulse + pipewire-alsa + pipewire-jack + wireplumber + pavucontrol + ffmpeg + imv + mpv +) + +font_packages=( + ttf-fira-code + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + noto-fonts-extra + ttf-liberation + ttf-dejavu + ttf-roboto +) + +app_packages=( + firefox +) + +machine_packages=( + nvidia-open +) + +if [[ ${EUID} -ne 0 ]]; then + printf 'Run this script as root inside arch-chroot.\n' >&2 + exit 1 +fi + +ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime +hwclock --systohc + +sed -i 's/^#\(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen +sed -i 's/^#\(pl_PL.UTF-8 UTF-8\)/\1/' /etc/locale.gen +locale-gen + +cat >/etc/locale.conf <<'EOF' +LANG=en_US.UTF-8 +EOF + +cat >/etc/vconsole.conf <<'EOF' +KEYMAP=pl2 +EOF + +bootctl install + +cat >/boot/loader/loader.conf <<'EOF' +default arch.conf +timeout 0 +console-mode max +editor no +EOF + +root_uuid=$(findmnt -no UUID /) +if [[ -z ${root_uuid} ]]; then + printf 'Could not detect root filesystem UUID. Check findmnt/blkid manually.\n' >&2 + exit 1 +fi + +cat >/boot/loader/entries/arch.conf </dev/null 2>&1; then + useradd -m -s /bin/bash -G wheel,video,render "${username}" +fi + +install -m 0750 -d /etc/sudoers.d +cat >/etc/sudoers.d/00-wheel <<'EOF' +%wheel ALL=(ALL:ALL) ALL +EOF +chmod 0440 /etc/sudoers.d/00-wheel +visudo -cf /etc/sudoers.d/00-wheel + +passwd "${username}" + +pacman -Syu --needed \ + "${core_packages[@]}" \ + "${network_packages[@]}" \ + "${desktop_packages[@]}" \ + "${media_packages[@]}" \ + "${font_packages[@]}" \ + "${app_packages[@]}" \ + "${machine_packages[@]}" + +updatedb +systemctl enable sshd.service + +printf '\nChroot setup complete. Exit, unmount /mnt, reboot, then log in as %s.\n' "${username}" +printf 'After first login, run: xdg-user-dirs-update\n' +printf 'After first login, run: systemctl --user enable --now pipewire pipewire-pulse wireplumber\n' +printf 'Generate SSH key after first login with: ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519\n'