feat: full rewrite in modules
This commit is contained in:
parent
33725b0188
commit
5cc6a0dd08
31 changed files with 283 additions and 215 deletions
14
modules/10-chroot/00-bootstrap.sh
Normal file
14
modules/10-chroot/00-bootstrap.sh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
|
||||
hwclock --systohc
|
||||
|
||||
for l in "${locales[@]}"; do
|
||||
sed -i "/^#\s*$l.UTF-8/s/^#\s*//" /etc/locale.gen
|
||||
done
|
||||
locale-gen
|
||||
|
||||
echo "LANG=$lang.UTF-8" > /etc/locale.conf
|
||||
|
||||
echo - "$hostname" > /etc/hostname
|
||||
20
modules/10-chroot/10-bootloader.sh
Normal file
20
modules/10-chroot/10-bootloader.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
bootctl install
|
||||
|
||||
root="$(findmnt -nr -o source /)"
|
||||
|
||||
cryptdev="$(cryptsetup status "$root" | awk '/device/ {print $2}')"
|
||||
[ -n "$cryptdev" ] && {
|
||||
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
|
||||
options="cryptdevice=$uuid:$(basename "$root") "
|
||||
}
|
||||
|
||||
options="${options}root=$root"
|
||||
|
||||
for f in /boot/loader/entries/*.conf; do
|
||||
cat << EOF >> "$f"
|
||||
options $options rw
|
||||
EOF
|
||||
done
|
||||
8
modules/10-chroot/20-users.sh
Normal file
8
modules/10-chroot/20-users.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
shell="$(sed -n "/$shell/{p;q}" /etc/shells)"
|
||||
useradd -mG wheel,video "$username" -s "${shell:-/bin/bash}"
|
||||
|
||||
echo "root:$root_passwd" | chpasswd
|
||||
echo - "$username:$user_passwd" | chpasswd
|
||||
11
modules/10-chroot/30-services.sh
Normal file
11
modules/10-chroot/30-services.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
systemctl enable \
|
||||
iwd.service \
|
||||
nftables.service \
|
||||
reflector.timer \
|
||||
systemd-networkd.service \
|
||||
systemd-resolved.service \
|
||||
systemd-timesyncd.service \
|
||||
tlp.service
|
||||
4
modules/10-chroot/40-flatpak.sh
Normal file
4
modules/10-chroot/40-flatpak.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
[ -n "$flatpak" ] && flatpak install -y "${flatpak[@]}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue