archiso: clone dotfiles into /etc/skel and add XDG user dirs

Populate /etc/skel with the Dotfiles repo and standard XDG directories
(Desktop, Documents, Downloads, Music, Pictures, Public, Templates, Videos)
before useradd -m, so the new user's home is fully set up at creation time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
The_miro 2026-05-12 14:52:01 +02:00
parent 76b1a0160f
commit ca792049f0
1 changed files with 8 additions and 4 deletions

View File

@ -163,8 +163,16 @@ hwclock --systohc
echo "$HOSTNAME" > /etc/hostname echo "$HOSTNAME" > /etc/hostname
systemctl enable NetworkManager systemctl enable NetworkManager
# Populate /etc/skel before user creation so useradd -m copies everything
echo "Cloning dotfiles into /etc/skel..."
git clone https://git.abdelbaki.eu/The_miro/Dotfiles.git /etc/skel/Dotfiles \
|| echo "Warning: dotfiles clone failed — clone manually after first boot."
mkdir -p /etc/skel/{Desktop,Documents,Downloads,Music,Pictures,Public,Templates,Videos}
useradd -m -G wheel -s /bin/zsh "$USERNAME" useradd -m -G wheel -s /bin/zsh "$USERNAME"
echo "$USERNAME:$USERPASS" | chpasswd echo "$USERNAME:$USERPASS" | chpasswd
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME"
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers
@ -197,10 +205,6 @@ if [[ "$ENABLE_FIDO_USER" == "YES" ]]; then
echo "auth required pam_u2f.so" >> /etc/pam.d/system-auth echo "auth required pam_u2f.so" >> /etc/pam.d/system-auth
fi fi
echo "Cloning dotfiles..."
git clone https://git.abdelbaki.eu/The_miro/Dotfiles.git /home/$USERNAME/Dotfiles \
&& chown -R $USERNAME:$USERNAME /home/$USERNAME/Dotfiles \
|| echo "Warning: dotfiles clone failed — clone manually after first boot."
EOF EOF