49 lines
1.6 KiB
Bash
Executable File
49 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# run_once_50-configure-system.sh
|
|
# System-level config, enable services and set some settings
|
|
|
|
set -euo pipefail
|
|
|
|
SYS="$(chezmoi data --format=json 2>/dev/null | jq -r '.system // "desktop"')"
|
|
DISTRO_ID="$(chezmoi data --format=json 2>/dev/null | jq -r '.chezmoi.osRelease.id // empty')"
|
|
SRC="$(chezmoi source-path)"
|
|
echo ">>> [configure] distro=$DISTRO_ID, system=$SYS, source=$SRC"
|
|
|
|
case "$DISTRO_ID" in
|
|
arch)
|
|
# pacman.conf — everyone on arch
|
|
sudo install -m644 "$SRC/assets/pacman.conf" /etc/pacman.conf
|
|
|
|
# MAKEFLAGS — everyone on arch
|
|
sudo sed -i 's/^#MAKEFLAGS=/MAKEFLAGS="-j'"$(nproc)"'"/' /etc/makepkg.conf
|
|
|
|
if [ "$SYS" != "server" ]; then
|
|
sudo systemctl enable bluetooth cups greetd
|
|
|
|
# minegrub GRUB theme (best-effort)
|
|
if [ -d /boot/grub/themes ]; then
|
|
sudo mkdir -p /boot/grub/themes/minegrub
|
|
sudo cp -r "$SRC/assets/minegrub/." /boot/grub/themes/minegrub/
|
|
if ! grep -q '^GRUB_THEME=' /etc/default/grub 2>/dev/null; then
|
|
echo 'GRUB_THEME="/boot/grub/themes/minegrub/theme.txt"' \
|
|
| sudo tee -a /etc/default/grub >/dev/null
|
|
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
|
fi
|
|
else
|
|
echo ">>> [configure] /boot/grub/themes missing — skipping minegrub install"
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
ubuntu)
|
|
echo ">>> [ubuntu] no configure system"
|
|
;;
|
|
|
|
*)
|
|
echo ">>> [configure] unsupported distro: ${DISTRO_ID:-unknown}, skipping"
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
echo ">>> [configure] done"
|