feat: cleanup and update

This commit is contained in:
ange 2024-04-03 19:33:40 +02:00
parent a4947dce17
commit 75d1075ca1
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
18 changed files with 86 additions and 88 deletions

View File

@ -1,11 +1,11 @@
# archinstall
My personal Arch install script. It automates from step 2 of ArchWiki's
[Installation guide](https://wiki.archlinux.org/title/Installation_guide) and
more!
[Installation guide](https://wiki.archlinux.org/title/Installation_guide#Installation)
and more!
## How to
## HOW-TO
Follow the [Pre-installation](https://wiki.archlinux.org/title/Installation_guide#Pre-installation).
Once you chrooted in the system, clone this script
Once you mounted the partitions, clone this script
```bash
git clone https://git.maby.dev/ange/archinstall /tmp/ai && cd "$_"
```
@ -27,5 +27,5 @@ $EDITOR ./desktop/$WM/config
For the dotfiles, run the script as the newly created user:
```bash
su $user -c ./dotfiles.sh
su - $user -c ./dotfiles.sh
```

14
config
View File

@ -19,30 +19,26 @@ locales=(
lang="${locales[0]}"
pkg=(
base{,-devel}
base{,-devel} man-{db,pages} tldr
efibootmgr
fuse
fzf
git
htop
jq
linux{,-lts,-firmware} mkinitcpio {amd,intel}-ucode
lsof
man-{db,pages} tldr
lf
linux{,-lts,-firmware} mkinitcpio
neofetch
neovim{,-lspconfig} python-pynvim ripgrep tree-sitter-cli
neovim{,-lspconfig} python-pynvim ripgrep tree-sitter-cli bash-language-server pyright python-black
networkmanager iptables-nft wireguard-tools bind gnu-netcat
opendoas
p7zip unrar
podman{,-compose}
ranger
reflector
renameutils perl-rename
rsync
terminus-font awesome-terminal-fonts
tlp
tree
udisks2
udisks2 dosfstools exfatprogs
zsh
)

View File

@ -2,21 +2,22 @@
# Comment to disable
pkg=(
aerc w3m
alacritty
dunst
dunst libnotify
feh
flameshot
gammastep
imagemagick
materia-{gtk-theme,kde} papirus-icon-theme gtk-engine-murrine
graphicsmagick
materia-gtk-theme papirus-icon-theme
monero
mpv
newsraft
noto-fonts{,-cjk,-emoji} ttf-{dejavu,liberation} otf-font-awesome
pass{,-otp}
qemu-{base,audio-pipewire,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq
pcmanfm
pcmanfm-gtk3
polkit-gnome
wireplumber pipewire-pulse pavucontrol playerctl
qemu-{base,audio-pipewire,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq
wireplumber pavucontrol playerctl
xdg-user-dirs
yt-dlp
zenity

View File

@ -5,7 +5,7 @@ pkg=(
autorandr
i3lock xss-lock
picom
xorg-{server,xinit,xrandr,xsetroot} xclip
xorg-{server,xinit,xrandr,xsetroot} xclip xdotool
)
# vim: ft=sh

View File

@ -5,4 +5,4 @@ cd "$(dirname "$0")"
cp -rfT rootfs/ /mnt/
cat config ../../src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
echo -e "${BOLD}${GREEN}DONE${NORMAL}"
echo "${BOLD}${GREEN}DONE${NORMAL}"

View File

@ -2,16 +2,18 @@
pac "${pkg[@]}"
# drivers
case "$(lspci -k | grep -A3 -E '(VGA|3D)')" in
case "$(lsmod)" in
*amdgpu*)
pac xf86-video-amdgpu
;;
*i915*)
pac xf86-video-intel
# https://wiki.archlinux.org/title/Intel_graphics#Installation
#pac xf86-video-intel
;;
*nouveau*)
# https://bugs.freedesktop.org/show_bug.cgi?id=94844#c3
#pac xf86-video-nouveau
;;
*)
;;
esac

View File

@ -4,4 +4,4 @@ cd "$(dirname "$0")"
cat config ../src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
echo -e "${BOLD}${GREEN}DONE${NORMAL}"
echo "${BOLD}${GREEN}DONE${NORMAL}"

View File

@ -3,22 +3,15 @@
pac "${pkg[@]}" flatpak xdg-desktop-portal-gtk mesa
flatpak install -y "${flatpakpkg[@]}"
case "$(lspci -k | grep -E '(VGA|3D)')" in
*AMD*)
pac vulkan-radeon
modules=amdgpu
;;
*Intel*)
pac vulkan-intel
modules=i915
;;
*NVIDIA*)
#pac vulkan-nvk
modules=nouveau
;;
if lsusb | grep -q Bluetooth; then
pac bluez bluez-utils
fi
case "$(lspci | grep 'VGA\|3D')" in
*AMD*) pac vulkan-radeon ;;
*Intel*) pac vulkan-intel ;;
*NVIDIA*) pac vulkan-nouveau ;;
*) ;;
esac
sed -i "/^MODULES=(/s/)/$modules)/" /etc/mkinitcpio.conf
mkinitcpio -P
xdg-user-dirs-update

View File

@ -3,6 +3,6 @@ cd "$(dirname "$0")"
. ./config
. ./src/lib.sh
cat src/dotfiles.sh | arch-chroot /mnt/ su "$username" -c 'bash -ex'
cat src/dotfiles.sh | arch-chroot /mnt/ su - "$username" -c 'bash -ex'
echo -e "${BOLD}${GREEN}DONE.${NORMAL}"
echo "${BOLD}${GREEN}DONE.${NORMAL}"

View File

@ -9,7 +9,7 @@ cd "$(dirname "$0")"
size="$swapfile"
;;
auto)
ram="$(free -m | awk '$1 == "Mem:" {print $2}')"
ram="$(free -m | awk '/^Mem:/ {print $2}')"
size="$(python -c "from math import ceil,log; print(2**ceil((log($ram)/log(2))))")"
;;
*)
@ -23,12 +23,10 @@ cd "$(dirname "$0")"
swapon /mnt/swapfile
)
cp -f rootfs/etc/pacman.conf /etc/pacman.conf
pacman -Sy
pacstrap -K /mnt/ --needed "${pkg[@]}"
pacstrap -C rootfs/etc/pacman.conf -K /mnt/ --needed "${pkg[@]}"
cp -rfT rootfs/ /mnt/
genfstab -U /mnt/ >> /mnt/etc/fstab
cat config src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
echo -e "${BOLD}${GREEN}DONE${NORMAL}"
echo "${BOLD}${GREEN}DONE${NORMAL}"

View File

@ -1,7 +0,0 @@
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
COMMIT

View File

@ -1,7 +0,0 @@
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
COMMIT

29
rootfs/etc/nftables.conf Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/nft -f
# vim:set ts=2 sw=2 et:
destroy table inet filter
table inet filter {
chain input {
type filter hook input priority filter; policy drop;
ct state invalid counter drop
iif "lo" counter accept
ip protocol {icmp,icmpv6} counter accept
ct state {established,related} counter accept
counter comment "dropped"
}
chain forward {
type filter hook forward priority filter; policy drop;
counter comment "dropped"
}
chain output {
type filter hook output priority filter; policy accept;
counter comment "accepted"
}
}

View File

@ -1,13 +0,0 @@
[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
[Action]
Description=Update NVIDIA module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'

View File

@ -0,0 +1 @@
/usr/bin/podman-compose

View File

@ -14,25 +14,30 @@ sed -i '/^HOOKS=(/s/filesystems/encrypt filesystems/' /etc/mkinitcpio.conf
# Services
systemctl enable \
NetworkManager \
ip6tables \
iptables \
NetworkManager.service \
nftables.service \
reflector.timer \
systemd-resolved \
systemd-timesyncd \
tlp
systemd-resolved.service \
systemd-timesyncd.service \
tlp.service
# Users
echo "root:$root_passwd" | chpasswd
useradd -mG wheel,video "$username" -s "${default_shell-/bin/bash}"
echo "$username:$user_passwd" | chpasswd
su "$username" -c 'xdg-user-dirs-update' 2> /dev/null || true
# ucode
case "$(lscpu)" in
*Intel*) pac amd-ucode ;;
*AMD*) pac intel-ucode ;;
*) ;;
esac
# Bootloader
bootctl install
root="$(findmnt -nr -o source /)"
cryptdev="$(cryptsetup status "$root" | grep device | awk '{print $2}' || true)"
cryptdev="$(cryptsetup status "$root" | awk '/device/{print $2}' || true)"
if [ -n "$cryptdev" ]; then
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
options="cryptdevice=$uuid:$(basename "$root") "

View File

@ -1,9 +1,9 @@
#!/bin/bash
if [ -t 1 ]; then
NORMAL='\e[0m'
BOLD='\e[1m'
GREEN='\e[32m'
NORMAL=$'\e[0m'
BOLD=$'\e[1m'
GREEN=$'\e[32m'
fi
function pac() {