feat: cleanup and update
This commit is contained in:
parent
a4947dce17
commit
75d1075ca1
10
README.md
10
README.md
@ -1,11 +1,11 @@
|
|||||||
# archinstall
|
# archinstall
|
||||||
My personal Arch install script. It automates from step 2 of ArchWiki's
|
My personal Arch install script. It automates from step 2 of ArchWiki's
|
||||||
[Installation guide](https://wiki.archlinux.org/title/Installation_guide) and
|
[Installation guide](https://wiki.archlinux.org/title/Installation_guide#Installation)
|
||||||
more!
|
and more!
|
||||||
|
|
||||||
## How to
|
## HOW-TO
|
||||||
Follow the [Pre-installation](https://wiki.archlinux.org/title/Installation_guide#Pre-installation).
|
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
|
```bash
|
||||||
git clone https://git.maby.dev/ange/archinstall /tmp/ai && cd "$_"
|
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:
|
For the dotfiles, run the script as the newly created user:
|
||||||
```bash
|
```bash
|
||||||
su $user -c ./dotfiles.sh
|
su - $user -c ./dotfiles.sh
|
||||||
```
|
```
|
||||||
|
14
config
14
config
@ -19,30 +19,26 @@ locales=(
|
|||||||
lang="${locales[0]}"
|
lang="${locales[0]}"
|
||||||
|
|
||||||
pkg=(
|
pkg=(
|
||||||
base{,-devel}
|
base{,-devel} man-{db,pages} tldr
|
||||||
efibootmgr
|
efibootmgr
|
||||||
fuse
|
|
||||||
fzf
|
fzf
|
||||||
git
|
git
|
||||||
htop
|
htop
|
||||||
jq
|
jq
|
||||||
linux{,-lts,-firmware} mkinitcpio {amd,intel}-ucode
|
lf
|
||||||
lsof
|
linux{,-lts,-firmware} mkinitcpio
|
||||||
man-{db,pages} tldr
|
|
||||||
neofetch
|
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
|
networkmanager iptables-nft wireguard-tools bind gnu-netcat
|
||||||
opendoas
|
opendoas
|
||||||
p7zip unrar
|
p7zip unrar
|
||||||
podman{,-compose}
|
podman{,-compose}
|
||||||
ranger
|
|
||||||
reflector
|
reflector
|
||||||
renameutils perl-rename
|
renameutils perl-rename
|
||||||
rsync
|
rsync
|
||||||
terminus-font awesome-terminal-fonts
|
terminus-font awesome-terminal-fonts
|
||||||
tlp
|
tlp
|
||||||
tree
|
udisks2 dosfstools exfatprogs
|
||||||
udisks2
|
|
||||||
zsh
|
zsh
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -2,21 +2,22 @@
|
|||||||
# Comment to disable
|
# Comment to disable
|
||||||
|
|
||||||
pkg=(
|
pkg=(
|
||||||
|
aerc w3m
|
||||||
alacritty
|
alacritty
|
||||||
dunst
|
dunst libnotify
|
||||||
feh
|
feh
|
||||||
flameshot
|
|
||||||
gammastep
|
gammastep
|
||||||
imagemagick
|
graphicsmagick
|
||||||
materia-{gtk-theme,kde} papirus-icon-theme gtk-engine-murrine
|
materia-gtk-theme papirus-icon-theme
|
||||||
monero
|
monero
|
||||||
mpv
|
mpv
|
||||||
|
newsraft
|
||||||
noto-fonts{,-cjk,-emoji} ttf-{dejavu,liberation} otf-font-awesome
|
noto-fonts{,-cjk,-emoji} ttf-{dejavu,liberation} otf-font-awesome
|
||||||
pass{,-otp}
|
pass{,-otp}
|
||||||
qemu-{base,audio-pipewire,hw-display-virtio-{gpu,vga},ui-gtk} dnsmasq
|
pcmanfm-gtk3
|
||||||
pcmanfm
|
|
||||||
polkit-gnome
|
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
|
xdg-user-dirs
|
||||||
yt-dlp
|
yt-dlp
|
||||||
zenity
|
zenity
|
||||||
|
@ -5,7 +5,7 @@ pkg=(
|
|||||||
autorandr
|
autorandr
|
||||||
i3lock xss-lock
|
i3lock xss-lock
|
||||||
picom
|
picom
|
||||||
xorg-{server,xinit,xrandr,xsetroot} xclip
|
xorg-{server,xinit,xrandr,xsetroot} xclip xdotool
|
||||||
)
|
)
|
||||||
|
|
||||||
# vim: ft=sh
|
# vim: ft=sh
|
||||||
|
@ -5,4 +5,4 @@ cd "$(dirname "$0")"
|
|||||||
cp -rfT rootfs/ /mnt/
|
cp -rfT rootfs/ /mnt/
|
||||||
cat config ../../src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
|
cat config ../../src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
|
||||||
|
|
||||||
echo -e "${BOLD}${GREEN}DONE${NORMAL}"
|
echo "${BOLD}${GREEN}DONE${NORMAL}"
|
||||||
|
@ -2,16 +2,18 @@
|
|||||||
|
|
||||||
pac "${pkg[@]}"
|
pac "${pkg[@]}"
|
||||||
|
|
||||||
# drivers
|
case "$(lsmod)" in
|
||||||
case "$(lspci -k | grep -A3 -E '(VGA|3D)')" in
|
|
||||||
*amdgpu*)
|
*amdgpu*)
|
||||||
pac xf86-video-amdgpu
|
pac xf86-video-amdgpu
|
||||||
;;
|
;;
|
||||||
*i915*)
|
*i915*)
|
||||||
pac xf86-video-intel
|
# https://wiki.archlinux.org/title/Intel_graphics#Installation
|
||||||
|
#pac xf86-video-intel
|
||||||
;;
|
;;
|
||||||
*nouveau*)
|
*nouveau*)
|
||||||
# https://bugs.freedesktop.org/show_bug.cgi?id=94844#c3
|
# https://bugs.freedesktop.org/show_bug.cgi?id=94844#c3
|
||||||
#pac xf86-video-nouveau
|
#pac xf86-video-nouveau
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -4,4 +4,4 @@ cd "$(dirname "$0")"
|
|||||||
|
|
||||||
cat config ../src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
|
cat config ../src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
|
||||||
|
|
||||||
echo -e "${BOLD}${GREEN}DONE${NORMAL}"
|
echo "${BOLD}${GREEN}DONE${NORMAL}"
|
||||||
|
@ -3,22 +3,15 @@
|
|||||||
pac "${pkg[@]}" flatpak xdg-desktop-portal-gtk mesa
|
pac "${pkg[@]}" flatpak xdg-desktop-portal-gtk mesa
|
||||||
flatpak install -y "${flatpakpkg[@]}"
|
flatpak install -y "${flatpakpkg[@]}"
|
||||||
|
|
||||||
case "$(lspci -k | grep -E '(VGA|3D)')" in
|
if lsusb | grep -q Bluetooth; then
|
||||||
*AMD*)
|
pac bluez bluez-utils
|
||||||
pac vulkan-radeon
|
fi
|
||||||
modules=amdgpu
|
|
||||||
;;
|
case "$(lspci | grep 'VGA\|3D')" in
|
||||||
*Intel*)
|
*AMD*) pac vulkan-radeon ;;
|
||||||
pac vulkan-intel
|
*Intel*) pac vulkan-intel ;;
|
||||||
modules=i915
|
*NVIDIA*) pac vulkan-nouveau ;;
|
||||||
;;
|
*) ;;
|
||||||
*NVIDIA*)
|
|
||||||
#pac vulkan-nvk
|
|
||||||
modules=nouveau
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
sed -i "/^MODULES=(/s/)/$modules)/" /etc/mkinitcpio.conf
|
|
||||||
mkinitcpio -P
|
|
||||||
|
|
||||||
xdg-user-dirs-update
|
xdg-user-dirs-update
|
||||||
|
@ -3,6 +3,6 @@ cd "$(dirname "$0")"
|
|||||||
. ./config
|
. ./config
|
||||||
. ./src/lib.sh
|
. ./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}"
|
||||||
|
@ -9,7 +9,7 @@ cd "$(dirname "$0")"
|
|||||||
size="$swapfile"
|
size="$swapfile"
|
||||||
;;
|
;;
|
||||||
auto)
|
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))))")"
|
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
|
swapon /mnt/swapfile
|
||||||
)
|
)
|
||||||
|
|
||||||
cp -f rootfs/etc/pacman.conf /etc/pacman.conf
|
pacstrap -C rootfs/etc/pacman.conf -K /mnt/ --needed "${pkg[@]}"
|
||||||
pacman -Sy
|
|
||||||
pacstrap -K /mnt/ --needed "${pkg[@]}"
|
|
||||||
cp -rfT rootfs/ /mnt/
|
cp -rfT rootfs/ /mnt/
|
||||||
genfstab -U /mnt/ >> /mnt/etc/fstab
|
genfstab -U /mnt/ >> /mnt/etc/fstab
|
||||||
|
|
||||||
cat config src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
|
cat config src/lib.sh src/install.sh | arch-chroot /mnt/ bash -ex
|
||||||
|
|
||||||
echo -e "${BOLD}${GREEN}DONE${NORMAL}"
|
echo "${BOLD}${GREEN}DONE${NORMAL}"
|
||||||
|
@ -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
|
|
@ -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
29
rootfs/etc/nftables.conf
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
@ -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'
|
|
1
rootfs/usr/local/bin/docker-compose
Symbolic link
1
rootfs/usr/local/bin/docker-compose
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/usr/bin/podman-compose
|
@ -14,25 +14,30 @@ sed -i '/^HOOKS=(/s/filesystems/encrypt filesystems/' /etc/mkinitcpio.conf
|
|||||||
|
|
||||||
# Services
|
# Services
|
||||||
systemctl enable \
|
systemctl enable \
|
||||||
NetworkManager \
|
NetworkManager.service \
|
||||||
ip6tables \
|
nftables.service \
|
||||||
iptables \
|
|
||||||
reflector.timer \
|
reflector.timer \
|
||||||
systemd-resolved \
|
systemd-resolved.service \
|
||||||
systemd-timesyncd \
|
systemd-timesyncd.service \
|
||||||
tlp
|
tlp.service
|
||||||
|
|
||||||
# Users
|
# Users
|
||||||
echo "root:$root_passwd" | chpasswd
|
echo "root:$root_passwd" | chpasswd
|
||||||
useradd -mG wheel,video "$username" -s "${default_shell-/bin/bash}"
|
useradd -mG wheel,video "$username" -s "${default_shell-/bin/bash}"
|
||||||
echo "$username:$user_passwd" | chpasswd
|
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
|
# Bootloader
|
||||||
bootctl install
|
bootctl install
|
||||||
|
|
||||||
root="$(findmnt -nr -o source /)"
|
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
|
if [ -n "$cryptdev" ]; then
|
||||||
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
|
uuid="$(blkid | grep "$cryptdev" | awk '{print $2}')"
|
||||||
options="cryptdevice=$uuid:$(basename "$root") "
|
options="cryptdevice=$uuid:$(basename "$root") "
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
NORMAL='\e[0m'
|
NORMAL=$'\e[0m'
|
||||||
BOLD='\e[1m'
|
BOLD=$'\e[1m'
|
||||||
GREEN='\e[32m'
|
GREEN=$'\e[32m'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function pac() {
|
function pac() {
|
||||||
|
Loading…
Reference in New Issue
Block a user