feat: UKI
This commit is contained in:
parent
bfbd034ce3
commit
dd265819a0
26 changed files with 55 additions and 56 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
|
||||
|
||||
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
|
||||
22
modules/10-chroot/10-bootloader.sh
Normal file
22
modules/10-chroot/10-bootloader.sh
Normal 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
|
||||
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}"
|
||||
|
||||
[ -n "$rootpasswd" ] && echo "root:$rootpasswd" | chpasswd
|
||||
echo "$username:$userpasswd" | chpasswd
|
||||
10
modules/10-chroot/30-services.sh
Normal file
10
modules/10-chroot/30-services.sh
Normal 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
|
||||
5
modules/10-chroot/40-flatpak.sh
Normal file
5
modules/10-chroot/40-flatpak.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
[ -s /chroot/flatpak.txt ] \
|
||||
&& xargs flatpak install -y --noninteractive < /chroot/flatpak.txt
|
||||
5
modules/10-chroot/50-dwm.sh
Normal file
5
modules/10-chroot/50-dwm.sh
Normal 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
|
||||
4
modules/10-chroot/user/10-services.sh
Normal file
4
modules/10-chroot/user/10-services.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
#shellcheck disable=SC2154
|
||||
|
||||
systemctl enable --user podman.socket
|
||||
11
modules/10-chroot/user/20-dotfiles.sh
Normal file
11
modules/10-chroot/user/20-dotfiles.sh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue