add bluetooth + move to run_once scripts

This commit is contained in:
Tobias Strobel 2022-03-06 15:44:09 +01:00
parent 70c042bf6a
commit a8c59e69cb
6 changed files with 336 additions and 413 deletions

View file

@ -225,6 +225,9 @@ basic_packages=(
"docbook-xls" # depenency of plymouth-git
"efitools" # provides KeyTool
"libfido2" # for systemd-cryptenroll
"bluez"
"bluez-utils"
"usbutils" # for lsusb
)
all_packages=(
${kernel_packages[@]}
@ -233,10 +236,9 @@ all_packages=(
${basic_packages[@]}
)
pacstrap /mnt base base-devel arch-secure-boot ${all_packages[@]}
pacstrap /mnt base base-devel arch-secure-boot chezmoi ${all_packages[@]}
echo -e "\n### Generating base config files"
echo "cryptdevice=PARTLABEL=primary:luks:allow-discards root=LABEL=btrfs rootflags=subvol=root rw quiet mem_sleep_default=deep" > /mnt/etc/kernel/cmdline
genfstab -L /mnt >> /mnt/etc/fstab
@ -255,62 +257,6 @@ echo -e "127.0.0.1\tlocalhost" >>/mnt/etc/hosts
echo -e "127.0.1.1\t$hostname" >>/mnt/etc/hosts
echo -e "\n::1\tlocalhost" >>/mnt/etc/hosts
# Propagate the systemd-resolved managed configuration to all clients (stub mode)
ln -sf /run/systemd/resolve/stub-resolv.conf /mnt/etc/resolv.conf
cat >/mnt/etc/systemd/network/20-wired.network <<EOF
[Match]
Name=en*
[Network]
DHCP=yes
[DHCPv4]
RouteMetric=10
UseDomains=true
[IPv6AcceptRA]
RouteMetric=10
UseDomains=yes
EOF
cat >/mnt/etc/systemd/network/25-wireless.network <<EOF
[Match]
Name=wl*
[Network]
DHCP=yes
[DHCPv4]
RouteMetric=20
UseDomains=true
[IPv6AcceptRA]
RouteMetric=20
UseDomains=yes
EOF
mkdir -p /mnt/etc/iwd
cat >/mnt/etc/iwd/main.conf <<EOF
[General]
EnableNetworkConfiguration=true
[Network]
EnableIPv6=true
EOF
arch-chroot /mnt systemctl enable systemd-timesyncd fstrim.timer systemd-networkd systemd-resolved iwd
cat >/mnt/etc/mkinitcpio.conf <<EOF
MODULES=(i915)
BINARIES=(/usr/bin/btrfs)
FILES=()
HOOKS=(base consolefont udev autodetect keyboard keymap modconf block encrypt filesystems fsck shutdown)
EOF
arch-chroot /mnt mkinitcpio -p linux
arch-chroot /mnt arch-secure-boot initial-setup
echo -e "\n### Configuring swap file"
swap_size=$(free --mebi | awk '/Mem:/ {print $2}')
swap_end=$(( $swap_size + 129 + 1 ))MiB
@ -336,11 +282,7 @@ arch-chroot /mnt passwd -dl root
echo -e "\n### Setting permissions on the custom repo"
arch-chroot /mnt chown -R "$user:$user" "/var/cache/pacman/${user}-local/"
echo -e "\n### Cloning dotfiles"
arch-chroot /mnt sudo -u $user bash -c 'git clone --recursive https://code.strobeto.de/strobeltobias/dotfiles.git ~/.dotfiles'
echo -e "\n### Cloning dotfiles and running initial setup"
arch-chroot /mnt sudo -u $user sh -c 'chezmoi init --apply https://code.strobeto.de/strobeltobias/dotfiles.git && chezmoi state delete-bucket --bucket=scriptState'
echo -e "\n### Running initial setup"
arch-chroot /mnt /home/$user/.dotfiles/setup-system.sh
arch-chroot /mnt sudo -u $user /home/$user/.dotfiles/setup-user.sh
echo -e "\n### DONE - reboot and re-run both ~/.local/share/chezmoi/setup-*.sh scripts"
echo -e "\n### DONE - reboot and re-run 'chezmoi apply' to complete system setup"