Skip to content

Instantly share code, notes, and snippets.

@mirsella
Last active July 17, 2024 13:17
Show Gist options
  • Save mirsella/7b648d4e569e7e8d47c6aeda07c222ad to your computer and use it in GitHub Desktop.
Save mirsella/7b648d4e569e7e8d47c6aeda07c222ad to your computer and use it in GitHub Desktop.
my arch post install script
#!/bin/bash
pkg='ntfs-3g pacman-contrib spectacle man man-pages youtube-music-bin yt-dlp inxi xdg-desktop-portal rclone unzip zip fuse2 tealdeer rclone keepassxc wl-clipboard kdeconnect yakuake firefox inetutils timeshift timeshift-autosnap ttf-jetbrains-mono-nerd'
pkg_dev='cmake python-pip nodejs ts-node npm pnpm yarn luarocks php composer julia github-cli jq nodejs-neovim python-pynvim rust rust-src rust-docs cargo-watch cargo-generate vimv kwalletcli-bin wezterm-git lazygit'
pkg_dotfiles='zsh neovim fzf starship oh-my-posh trash-d bat fd ripgrep lsd chezmoi dust zoxide lazygit'
pkg_android='android-google-apis-playstore-x86-system-image android-apktool android-emulator android-platform android-sdk android-sdk-build-tools android-sdk-cmake android-sdk-cmdline-tools-latest android-sdk-platform-tools android-tools android-udev'
# install paru
if ! pacman -Q paru &> /dev/null; then
sudo pacman -Syu --noconfirm git
git clone https://aur.archlinux.org/paru.git || exit
pushd paru || exit 1
makepkg -si --noconfirm || exit
popd || exit 1
rm -rf paru
fi
# pacman.conf
echo 'NoExtract = etc/xdg/autostart/org.kde.discover.notifier.desktop' >> /etc/pacman.conf
sudo sed -i 's/^#Color$/Color/' /etc/pacman.conf
sudo sed -i 's/^#VerbosePkgLists$/VerbosePkgLists/' /etc/pacman.conf
sudo sed -i 's/^#ParallelDownloads = \([0-9]*\)$/ParallelDownloads = \1/' /etc/pacman.conf
# add chaotic-aur repo
sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
sudo pacman-key --lsign-key 3056513887B78AEB
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
grep --quiet chaotic-aur /etc/pacman.conf || echo "
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist " | sudo tee -a /etc/pacman.conf
echo "# Automatic per-country routing of the mirrors below.
Server = https://geo-mirror.chaotic.cx/\$repo/\$arch" | sudo tee /etc/pacman.d/chaotic-mirrorlist
sudo pacman -Syu --noconfirm || exit
# add archlinuxcn repo
grep --quiet archlinuxcn /etc/pacman.conf || echo "
[archlinuxcn]
Server = https://repo.archlinuxcn.org/\$arch
" | sudo tee -a /etc/pacman.conf
sudo pacman -Sy --noconfirm && sudo pacman -S --noconfirm archlinuxcn-keyring || exit
# add blackarch repo
curl -O https://blackarch.org/strap.sh
chmod +x strap.sh
sudo ./strap.sh
rm -v strap.sh
sudo pacman -Syu --noconfirm
# install pkgs
paru -Syu --noconfirm $pkg $pkg_dev $pkg_dotfiles $androidpkg || exit
# install touchpad drivers for laptop
if [[ $(hostname) = "laptop" || $(hostname) = "tosh" || $(hostname) = "unowhy" ]]; then
paru -S --noconfirm xf86-input-libinput
fi
# sudo without password
sudo sed -i 's/mirsella ALL=(ALL) ALL/mirsella ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers.d/00_mirsella
# install dotfiles
chezmoi init --apply https://github.com/mirsella/dotfiles
chezmoi git -- remote set-url origin git@github.com:mirsella/dotfiles
# ssh key-gen
ssh-keygen -t ed25519 -C "mirsella@protonmail.com"
echo ==================================
cat ~/.ssh/id_ed25519.pub
echo ==================================
echo '
TODO:
konsole profile: select jetbrains nerd font, add rose pine themes
rclone config, install rclone.service
add ssh key to github account: gh auth login
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment