diff --git a/README.md b/README.md index 9823f3b..10e3ea6 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/config b/config index b9832c6..6a9fc4a 100644 --- a/config +++ b/config @@ -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 ) diff --git a/desktop/config b/desktop/config index 9edc79f..1e33b9c 100644 --- a/desktop/config +++ b/desktop/config @@ -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 diff --git a/desktop/dwm/config b/desktop/dwm/config index 4ed5023..9f633ff 100644 --- a/desktop/dwm/config +++ b/desktop/dwm/config @@ -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 diff --git a/desktop/dwm/install.sh b/desktop/dwm/install.sh index 3c703c9..992947a 100755 --- a/desktop/dwm/install.sh +++ b/desktop/dwm/install.sh @@ -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}" diff --git a/desktop/dwm/rootfs/etc/X11/xorg.conf.d/50-mouse-acceleration.conf b/desktop/dwm/rootfs/etc/X11/xorg.conf.d/50-mouse.conf similarity index 100% rename from desktop/dwm/rootfs/etc/X11/xorg.conf.d/50-mouse-acceleration.conf rename to desktop/dwm/rootfs/etc/X11/xorg.conf.d/50-mouse.conf diff --git a/desktop/dwm/src/install.sh b/desktop/dwm/src/install.sh index 8d0efca..50812a6 100644 --- a/desktop/dwm/src/install.sh +++ b/desktop/dwm/src/install.sh @@ -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 diff --git a/desktop/install.sh b/desktop/install.sh index 87613c9..5fc8116 100755 --- a/desktop/install.sh +++ b/desktop/install.sh @@ -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}" diff --git a/desktop/src/install.sh b/desktop/src/install.sh index e92a358..9bdcbcf 100644 --- a/desktop/src/install.sh +++ b/desktop/src/install.sh @@ -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 diff --git a/dotfiles.sh b/dotfiles.sh index 1fc5551..5f0b26a 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -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}" diff --git a/install.sh b/install.sh index 4b07706..6987bd7 100755 --- a/install.sh +++ b/install.sh @@ -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}" diff --git a/rootfs/etc/iptables/ip6tables.rules b/rootfs/etc/iptables/ip6tables.rules deleted file mode 100644 index 62a5d94..0000000 --- a/rootfs/etc/iptables/ip6tables.rules +++ /dev/null @@ -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 diff --git a/rootfs/etc/iptables/iptables.rules b/rootfs/etc/iptables/iptables.rules deleted file mode 100644 index 62a5d94..0000000 --- a/rootfs/etc/iptables/iptables.rules +++ /dev/null @@ -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 diff --git a/rootfs/etc/nftables.conf b/rootfs/etc/nftables.conf new file mode 100644 index 0000000..fc4ecb3 --- /dev/null +++ b/rootfs/etc/nftables.conf @@ -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" + } +} diff --git a/rootfs/etc/pacman.d/hooks/10-nvidia.hook b/rootfs/etc/pacman.d/hooks/10-nvidia.hook deleted file mode 100644 index 7198a90..0000000 --- a/rootfs/etc/pacman.d/hooks/10-nvidia.hook +++ /dev/null @@ -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' diff --git a/rootfs/usr/local/bin/docker-compose b/rootfs/usr/local/bin/docker-compose new file mode 120000 index 0000000..ac6ac72 --- /dev/null +++ b/rootfs/usr/local/bin/docker-compose @@ -0,0 +1 @@ +/usr/bin/podman-compose \ No newline at end of file diff --git a/src/install.sh b/src/install.sh index 4aa1735..592e0a0 100644 --- a/src/install.sh +++ b/src/install.sh @@ -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") " diff --git a/src/lib.sh b/src/lib.sh index ca029d2..356c52a 100644 --- a/src/lib.sh +++ b/src/lib.sh @@ -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() {