Last active
April 1, 2025 20:46
-
-
Save mirsella/7b648d4e569e7e8d47c6aeda07c222ad to your computer and use it in GitHub Desktop.
my arch post install script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export pkg='ntfs-3g pacman-contrib spectacle man man-pages youtube-music-bin yt-dlp inxi rclone unzip zip fuse2 tealdeer keepassxc wl-clipboard kdeconnect yakuake zen-browser-bin inetutils timeshift timeshift-autosnap ttf-jetbrains-mono-nerd fwupd fwupd-efi sbctl aspell aspell-en aspell-fr hunspell hunspell-en_US hunspell-fr wine bottles viu chromium imagemagick' | |
export pkg_dev='cmake python-pip nodejs npm pnpm github-cli jujutsu jq nodejs-neovim python-pynvim vimv kwalletcli-bin chaotic-aur/wezterm-git lazygit docker docker-compose' | |
export pkg_dotfiles='zsh nushell carapace-bin fish neovim fzf starship oh-my-posh trash-d bat fd ripgrep lsd chezmoi dust zoxide lazygit darkman' | |
export 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' | |
export XDG_CONFIG_HOME="$HOME/.config" | |
export XDG_CACHE_HOME="$HOME/.cache" | |
export XDG_DATA_HOME="$HOME/.local/share" | |
export XDG_STATE_HOME="$HOME/.local/state" | |
export GNUPGHOME="$XDG_DATA_HOME"/gnupg | |
export CARGO_HOME="$XDG_DATA_HOME"/cargo | |
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup | |
# install rust | |
sudo pacman -S --noconfirm rustup | |
rustup toolchain install nightly | |
rustup component add rust-src rust-analyzer | |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
cargo binstall -y wasm-pack cargo-expand cargo-watch | |
# install paru | |
if ! pacman -Q paru &>/dev/null; then | |
sudo pacman -Syu --noconfirm git | |
git clone https://aur.archlinux.org/paru.git || exit | |
cd paru || exit | |
makepkg -si --noconfirm || exit | |
cd .. | |
rm -rf paru | |
fi | |
# pacman.conf | |
# echo '\nNoExtract = 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 | |
sudo sed -i '/#\[multilib\]/{N;s/#\[multilib\]\n#Include = \/etc\/pacman.d\/mirrorlist/\[multilib\]\nInclude = \/etc\/pacman.d\/mirrorlist/}' /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 --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' | |
sudo pacman -U --noconfirm '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 $pkg_android || exit | |
# install touchpad drivers for laptop | |
if [[ $(hostname) = "laptop" || $(hostname) = "tosh" || $(hostname) = "unowhy" ]]; then | |
paru -S --noconfirm xf86-input-libinput power-profiles-daemon fprint | |
fi | |
# sudo without password | |
sudo sed -i 's/mirsella ALL=(ALL) ALL/mirsella ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers.d/00_mirsella | |
# disable systemd-boot timeout | |
sudo sed -i 's/timeout 3/timeout 0/' /boot/loader/loader.conf | |
# install dotfiles | |
chezmoi init --apply https://github.com/mirsella/dotfiles | |
chezmoi git -- remote set-url origin [email protected]:mirsella/dotfiles | |
sudo cp -r ~/.local/share/chezmoi/etc/* /etc/ | |
systemctl --user daemon-reload | |
systemctl --user enable rclone-drive.service | |
systemctl --user enable --now darkman | |
sudo locale-gen | |
# setup rclone | |
rclone config create gdrive drive | |
systemctl --user start rclone-drive.service | |
keepassxc & disown | |
gh auth login -p ssh -h github.com | |
# gpg key for github | |
cat >gen-key-script <<EOF | |
%no-protection | |
Key-Type: RSA | |
Key-Length: 4096 | |
Name-Real: mirsella | |
Name-Email: [email protected] | |
Expire-Date: 0 | |
EOF | |
gpg --batch --generate-key gen-key-script | |
rm gen-key-script | |
gpgkeyid=$(gpg --list-secret-keys --keyid-format LONG | grep -Eo 'rsa4096/[A-Z0-9]{16}' | head -n 1 | cut -c 9-) | |
gpg --export --armor $gpgkeyid >gpg-key.txt | |
sed -i "s/$(hostname) = .*/$(hostname) = \"$gpgkeyid\"/" ~/.local/share/chezmoi/.chezmoidata.toml | |
chezmoi re-add | |
echo "add this gpg key to your github account" | |
cat gpg-key.txt | |
sudo systemctl enable --now sshd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment