a bunch of stuff i lost track

This commit is contained in:
SArpnt 2023-09-16 23:28:16 -04:00
parent 69bd4e6fe0
commit 4c3e58d03f
Signed by: SArpnt
SSH Key Fingerprint: SHA256:wyRI40FXp6te9QA9r2OFJf+DtCZQmqZFNTj7EV6aMDA
2 changed files with 155 additions and 129 deletions

106
in-chroot.fish Normal file
View File

@ -0,0 +1,106 @@
#TODO timezone
#ln -sf /usr/share/zoneinfo/*/* /etc/localtime
hwclock --systohc
cat /etc/locale.gen | sed "s/^#en_US.UTF-8/en_US.UTF-8/" > /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "choose a hostname (name for the computer, other computers may see it"
ask cool-arch-(cat /dev/urandom | base32 -w 8 | head -n 1) > /etc/hostname # TODO default hostname
#TODO mkinitcpio
begin
set -l packages
set -a packages (pacman -Si base-devel | grep "Depends On" | sed "s/^.*://" | sed "s/sudo//g")
set -a packages opendoas
#TODO desktop
set -a packages xorg-xwayland
# don't use all kde programs, many suck
set -a packages pcmanfm-qt xarchiver foot
set -a packages weston sddm sddm-kcm
set -a packages gnome-themes-extra breeze-icons
set -a packages firewalld # this is literally the only program with network zones, it sucks
#TODO network
#TODO other types
#TODO fonts
set -a packages noto-fonts ttf-fira-sans ttf-fira-mono wqy-zenhei
#TODO check general programs
set -a packages grub
# filesystem stuff
set -a packages gvfs-mtp gvfs-smb gvfs-ptp p7zip # TODO unrar?
# todo check other things for archiver
set -a packages ntfs-3g dosfstools btrfs-progs exfatprogs
set -a packages gparted
set -a packages chrony dnsmasq fish fzf fluidsynth soundfont-fluid
set -a packages networkmanager neofetch
set -a packages pipewire-audio pipewire-alsa pipewire-jack pipewire-pulse lib32-pipewire lib32-pipewire-jack wireplumber
set -a packages rtkit realtime-privileges
set -a packages ripgrep-all
set -a packages qt5-wayland qt6-wayland
set -a packages man-db man-pages texinfo tldr
# extra programs
set -a packages libreoffice-fresh kdenlive krita inkscape blender keepassxc mpv qbittorrent yt-dlp
# developer programs
set -a packages rustup git mosh rsync ventoy-bin pnpm esbuild miniupnpc
#TODO
set -a packages mesa lib32-mesa
set -a packages qt5ct qt6ct
# platform specific
#bluetooth
#gpu
#fingerprint reader
#TODO OTHER types
set -a packages efibootmgr os-prober intel-ucode amd-ucode
pacman -Syu --needed --noconfirm $packages
pacman -Fy
end
ln -sf /bin/doas /bin/sudo
# grub
switch (cat /sys/firmware/efi/fw_platform_size)
case 64
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB # TODO id
case 32
grub-install --target=i386-efi --efi-directory=/boot --bootloader-id=GRUB # TODO id
case ""
grub-install --target=i386-pc /dev/sdX # TODO
end
#TODO edit grub config
#check the nvidia thing
cat /etc/default/grub | sed "
s/resume=\$RESUME\$/$(
if test (count $swapdevice) -gt 0
echo resume=$swapdevice
end
)/
" > /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
passwd -l root
echo "select a username"
"^[a-z][-a-z0-9]*\$"
set -l username (ask "user")
useradd -m -G games,realtime,wheel $username
#TODO chrony
#TODO fluidsynth
runuser $user -c 'git clone "https://aur.archlinux.org/paru-bin.git" /tmp/paru-bin'
pushd /tmp/paru-bin
runuser $user -c 'makepkg -sir --noconfirm'
popd
rm -rf /tmp/paru-bin
runuser $user -c 'paru -Syu --noconfirm dashbinsh doasedit-alternative fish-z-git librewolf-bin ttf-twemoji'

178
main.fish
View File

@ -1,17 +1,16 @@
#!/usr/bin/env fish
# reads input, $1 is default result
function ask
if test $input = ""
echo $1
if test $1 = ""
read -p "echo '> '" input
else
echo $input
end
read -p "echo '[$1]> '" input
if test $input = ""
echo $1
else
echo $input
read -p "echo '[$1]> '" input
if test $input = ""
echo $1
else
echo $input
end
end
end
@ -56,38 +55,48 @@ switch (cat /sys/firmware/efi/fw_platform_size)
end
# extract overlay into system
tar xvf ./overlay.tar
tar xvf overlay.tar --directory=/mnt
# make /mnt/etc/fstab
touch /mnt/etc/fstab
function getdevice
set -l uuid (lsblk $1 -rno uuid)
if test -n $uuid
echo UUID=$uuid
else
echo $words[1]
end
end
for mountline in (mount | grep "on /mnt")
set -l words (string split " " $mountline)
set -l device (getdevice $words[1])
set -l mountpoint $words[3]
set -l filesystem $words[5]
set -l check (
switch $path
case "/"
echo 1
case "/*"
echo 2
case "*"
echo 0
set -lx swapdevice
begin
function getdevice
set -l uuid (lsblk $1 -rno uuid)
if test -n $uuid
echo UUID=$uuid
else
echo $words[1]
end
)
echo "$device $mountpoint $filesystem defaults 0 $check" >> /mnt/etc/fstab
end
for swapline in (swapon --raw --noheadings --show=NAME)
set -l device (getdevice $swapline)
echo "$device none swap defaults 0 0" >> /mnt/etc/fstab
end
for mountline in (mount | grep "on /mnt")
set -l words (string split " " $mountline)
set -l device (getdevice $words[1])
set -l mountpoint $words[3]
set -l filesystem $words[5]
set -l check (
switch $path
case "/"
echo 1
case "/*"
echo 2
case "*"
echo 0
end
)
echo "$device $mountpoint $filesystem defaults 0 $check" >> /mnt/etc/fstab
end
set -l swaplines (swapon --raw --noheadings --show=NAME)
if test (count $swaplines) -gt 1
echo "pick a swap device to use for hibernate"
echo "0 for no hibernate"
swapon --show=NAME,TYPE,SIZE,PRIO,UUID # TODO add line numbers, figure out what swap label is, figure out swap priority
ask 1 # TODO
set swapdevice
end
for swapline in $swaplines
set -l device (getdevice $swapline)
echo "$device none swap defaults 0 0" >> /mnt/etc/fstab
end
end
echo "```"
@ -100,96 +109,7 @@ $SHELL
# pacstrap
pacstrap -K /mnt base linux-zen linux-zen-headers linux-firmware fish
arch-chroot /mnt /bin
#TODO apply overlay
#TODO timezone
hwclock --systohc
cat /etc/locale.gen | sed "s/^#en_US.UTF-8/en_US.UTF-8/" > /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
#TODO hostname
echo "hostname" > /etc/hostname
#TODO mkinitcpio
pacman -Syu --needed \ #--noconfirm # TODO
(pacman -Si base-devel | grep "Depends On" | sed "s/^.*://" | sed "s/sudo//g") \
doas \
#TODO desktop
xorg-xwayland \
# don't use all kde programs, many suck
pcmanfm-qt xarchiver foot \
weston sddm sddm-kcm \
gnome-themes-extra breeze-icons \
#TODO firewall
#TODO network
#TODO other types
#TODO fonts
#TODO check general programs
grub gvfs-mtp gvfs-smb gvfs-ptp p7zip wqy-zenhei \ # TODO unrar?
chrony dnsmasq fish fzf fluidsynth soundfont-fluid \
gparted ntfs-3g dosfstools btrfs-progs exfatprogs \
networkmanager neofetch \
pipewire-audio pipewire-alsa pipewire-jack pipewire-pulse lib32-pipewire lib32-pipewire-jack wireplumber \
rtkit realtime-privileges \
ripgrep-all
qt5-wayland qt6-wayland \
man-db man-pages texinfo tldr \
# extra programs
libreoffice-fresh kdenlive krita inkscape blender keepassxc mpv qbittorrent yt-dlp
# developer programs
rustup git mosh rsync ventoy-bin pnpm esbuild miniupnpc
#TODO
mesa lib32-mesa
qt5ct qt6ct
# platform specific
#bluetooth
#gpu
#fingerprint reader
#TODO OTHER types
efibootmgr os-prober intel-ucode amd-ucode
pacman -Fy
ln -sf /bin/doas /bin/sudo
# grub
switch (cat /sys/firmware/efi/fw_platform_size)
case 64
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB # TODO id
case 32
grub-install --target=i386-efi --efi-directory=/boot --bootloader-id=GRUB # TODO id
case ""
grub-install --target=i386-pc /dev/sdX # TODO
end
grub-mkconfig -o /boot/grub/grub.cfg
passwd -l root
useradd -m -G games,realtime,wheel
#TODO chrony
#TODO fluidsynth
arch-chroot /mnt /bin/fish in-chroot.fish
# AFTER BOOT
# TODO connect to internet
git clone "https://aur.archlinux.org/paru-bin.git" /tmp/paru-bin
pushd /tmp/paru-bin
makepkg -sirc
popd
rm -rf /tmp/paru-bin
paru -Syu dashbinsh doasedit-alternative fish-z-git librewolf-bin ttf-twemoji