ElfOS/first-boot.sh
2025-11-30 23:48:20 +01:00

65 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
. /first-boot.env
. $CONFIG_DIR/elfos.sh
run root "disable first boot service" "systemctl disable first_boot.service"
echo
echo === install tools
echo
run root "enable NetworkMaanger" "systemctl enable NetworkManager.service"
run root "start NetworkMaanger" "systemctl start NetworkManager.service"
run root "wait for network" "while [[ 1 ]] ; do ping -c1 1.1.1.1 && break ; done"
run root "install base tools" "pacman -Sy --noconfirm \
usbutils dosfstools exfat-utils net-tools bind nmap libfido2 \
base-devel vim neovim helix curl ncdu btop git flatpak screen"
run root "install dev tools" "pacman -S --noconfirm \
ansible python3 gcc make cmake nodejs npm clang \
arm-none-eabi-gcc arm-none-eabi-newlib chezmoi"
# run root "install gnome" "pacman -S --noconfirm gnome"
# run root "enable gnome" "systemctl enable gdm.service"
run root "install niri" "pacman -S --noconfirm \
niri xwayland-satellite xdg-desktop-portal-gnome xdg-desktop-portal-gtk \
alacritty waybar qt6-multimedia-ffmpeg greetd-tuigreet walker"
run root "install docker" "pacman -S --noconfirm docker"
run root "add $USERNAME to docker group" "usermod -aG docker $USERNAME"
#TODO: gnome-keyring
#TODO: enable polkit
#TODO: setup swaylock
#TODO: setup tuigreet (greetd)
# paru -S dms-shell-bin matugen wl-clipboard cliphist cava
systemctl --user add-wants niri.service
run root "config polkit" "sed --in-place -e 's/wheel/admin/g' /usr/share/polkit-1/rules.d/50-default.rules"
run root "update fail lock" "sed --in-place -e 's/^deny = .*$/deny = 10/' -e 's/^unlock_time = .*$/unlock_time = 60/' /etc/security/faillock.conf"
echo
echo === setup blutooth
echo
run root "install bluez" "pacman -S --noconfirm bluez bluez-tools"
run root "enable bluez" "systemctl enable bluetooth"
for part in $(echo "$INSTALL_PARTS" | tr ',' ' ')
do
echo
echo === install part: $part
echo
$CONFIG_DIR/install_$part.sh
done
echo
echo === clean and reboot
echo
# run root "remove config sources" "rm -r \"$CONFIG_DIR\""
run root "remove first boot script" "rm /first-boot.sh /first-boot.env /etc/systemd/system/first-boot.service"
run root "reboot" "shutdown -r now"