feat: UKI

This commit is contained in:
ange 2024-10-02 12:40:34 +07:00
parent bfbd034ce3
commit dd265819a0
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
26 changed files with 55 additions and 56 deletions

View file

@ -0,0 +1,14 @@
#!/bin/bash
#shellcheck disable=SC2154
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
hwclock --systohc
while read -r l; do
sed -i "/^#\s*$l.UTF-8/s/^#\s*//" /etc/locale.gen
done <<< "${locales//,/$'\n'}"
locale-gen
echo "LANG=$lang.UTF-8" > /etc/locale.conf
echo "$hostname" > /etc/hostname

View file

@ -0,0 +1,22 @@
#!/bin/bash
#shellcheck disable=SC2154
root="$(findmnt -n -osource /)"
boot="$(lsblk -ls -oname /dev/disk/by-partlabel/boot | tail -n1)"
cryptdev="$(cryptsetup status "$root" | awk '/device/ {print $2}')"
[ -n "$cryptdev" ] && {
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
options="cryptdevice=$uuid:${root##*/} "
}
options="${options}root=$root rw"
sbctl create-keys
sbctl enroll-keys
for l in arch{,-lts-fallback}; do
efibootmgr --create --unicode --label "$l" \
--disk "$boot" --part 1 --loader "\EFI\Linux\arch-linux$l.efi"
done
echo "$options" > /etc/cmdline.d/root.conf

View 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}"
[ -n "$rootpasswd" ] && echo "root:$rootpasswd" | chpasswd
echo "$username:$userpasswd" | chpasswd

View file

@ -0,0 +1,10 @@
#!/bin/bash
#shellcheck disable=SC2154
systemctl enable iwd.service
systemctl enable nftables.service
systemctl enable reflector.timer
systemctl enable systemd-networkd.service
systemctl enable systemd-resolved.service
systemctl enable systemd-timesyncd.service
systemctl enable tlp.service

View file

@ -0,0 +1,5 @@
#!/bin/bash
#shellcheck disable=SC2154
[ -s /chroot/flatpak.txt ] \
&& xargs flatpak install -y --noninteractive < /chroot/flatpak.txt

View file

@ -0,0 +1,5 @@
#!/bin/bash
#shellcheck disable=SC2154
git clone --depth 1 https://git.maby.dev/ange/.dotfiles.git /tmp/dotfiles
/tmp/dotfiles/.config/suckless/update.sh

View file

@ -0,0 +1,4 @@
#!/bin/bash
#shellcheck disable=SC2154
systemctl enable --user podman.socket

View file

@ -0,0 +1,11 @@
#!/bin/bash
#shellcheck disable=SC2154
config=(git --git-dir "$HOME/.dotfiles" --work-tree "$HOME")
repo='https://git.maby.dev/ange/.dotfiles.git'
git clone --bare "$repo" "$HOME/.dotfiles"
"${config[@]}" checkout -f
"${config[@]}" submodule update --init --recursive --remote
"${config[@]}" config status.showUntrackedFiles no
"${config[@]}" remote set-url origin git@git.maby.dev:ange/.dotfiles.git