scripts/void-init.sh

27 lines
541 B
Bash
Raw Normal View History

2024-08-19 10:06:11 +03:00
#!/bin/bash
if [ -z "$USERNAME" ]; then
2024-08-19 15:31:13 +03:00
USERNAME="spirit"
2024-08-19 10:06:11 +03:00
fi
cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
xbps-install -Suy xbps
xbps-install -uy
xbps-install -y base-system
xbps-remove -y base-voidstrap
xbps-reconfigure -fa
useradd -m -G wheel -s /bin/bash $USERNAME
2024-08-19 15:31:13 +03:00
sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
2024-08-19 10:06:11 +03:00
xbps-install -y opendoas
bash -c "echo 'permit nopass $USERNAME as root' > /etc/doas.conf"
2024-08-19 10:06:11 +03:00
if [[ "$1" == "--wsl" ]]; then
cat <<EOF > /etc/wsl.conf
[user]
default=$USERNAME
EOF
fi