Skip to content

Instantly share code, notes, and snippets.

@alvarosainzpardo
Last active July 14, 2023 15:40
Show Gist options
  • Save alvarosainzpardo/aacdac2ac0686204feb99989c41b6a17 to your computer and use it in GitHub Desktop.
Save alvarosainzpardo/aacdac2ac0686204feb99989c41b6a17 to your computer and use it in GitHub Desktop.
Arch Linux common setup
#!/bin/bash
# IMPORTANT: edit variables as needed
export ssid='SSID'
export psk='PSK'
# IMPORTANT: Activate wifi connection
# sudo nmcli dev wifi connect "$ssid" password "$psk"
# IMPORTANT: Copy ssh keys - mandatory for git commands to alvarosainpardo repos
mkdir ~/.ssh
# cp <SOURCEDIR>/.ssh/authorized_keys ~/.ssh
# cp <SOURCEDIR>/.ssh/known_hosts ~/.ssh
# cp <SOURCEDIR>/.ssh/id_rsa* ~/.ssh
# Activate NTP
sudo timedatectl set-ntp true
# Set keymap using localectl
sudo localectl set-keymap es
# Enable multilib repository
sudo sed -i '/^#\s*\[multilib\]/,+1 s/^#\s*//' /etc/pacman.conf
# Update packages
sudo pacman -Suyy
# Install common packages
sudo pacman -S --noconfirm --needed acpid acpi acpi_call-dkms git nm-connection-editor network-manager-applet man-db man-pages neofetch chromium firefox stow htop tree mlocate pacman-contrib pkgfile tmux wget obsidian gparted dosfstools mtools ntfs-3g rsync bluez bluez-utils blueman ttf-jetbrains-mono-nerd noto-fonts ttf-noto-nerd
# Install USB drives mount support
sudo pacman -S --noconfirm --needed udisks2 gvfs gvfs-mtp gvfs-gphoto2 gvfs-afc
# Install Xorg
sudo pacman -S --noconfirm --needed xorg-server xorg-apps
# Install Intel graphic driver
sudo pacman -S --noconfirm --needed xf86-video-intel intel-media-driver intel-gpu-tools mesa mesa-utils libva-utils
# Install NVIDIA graphic driver
sudo pacman -S --noconfirm --needed nvidia nvidia-utils nvidia-settings nvidia-prime vdpauinfo
# Install ALSA
sudo pacman -S --noconfirm --needed alsa-utils alsa-plugins
# Install Pipewire
sudo pacman -S --noconfirm --needed pavucontrol pipewire-alsa pipewire-pulse pipewire-jack pipewire-zeroconf wireplumber
# Install GStreamer
sudo pacman -S --noconfirm --needed gstreamer gst-plugin-pipewire gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gstreamer-vaapi
# Install dotfiles repo
cd
git clone [email protected]:alvarosainzpardo/dotfiles.git
# Setup dotfiles using stow
cd ~/dotfiles
stow git
stow ssh
cd
# Enable ACPI daemon
# Disable ordinary key events
sudo sh -c 'cat > /etc/acpi/events/buttons << "EOF"
event=button/(up|down|left|right|kpenter)
action=<drop>
EOF'
sudo systemctl enable acpid
# Enable bluetooth service
sudo systemctl enable bluetooth
# Enable reflector timer
sudo systemctl enable reflector.timer
# Enable fstrim timer
sudo systemctl enable fstrim.timer
# Install yay
mkdir ~/tmp
cd ~/tmp
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
cd ..
rm -fr yay-bin
cd
# Install paru
yay -S paru-bin
# Enable pkgfile update timer
sudo systemctl enable pkgfile-update.timer
# Install AUR packages
yay -S google-chrome xfce4-docklike-plugin
# Setup Obsidian vault
cd
git clone [email protected]:alvarosainzpardo/obsidian.git
# Install QEMU / virt-manager
sudo pacman -S --needed virt-manager qemu-desktop dnsmasq iptables-nft
sudo cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.arch
sudo sed -i '/^#\s*unix_sock_group/ s/^#\s*//' /etc/libvirt/libvirtd.conf
sudo sed -i '/^#\s*unix_sock_rw_perms/ s/^#\s*//' /etc/libvirt/libvirtd.conf
sudo cp /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.arch
sudo sed -i '/^#user/ s/^#//' /etc/libvirt/qemu.conf
sudo sed -i '/^#group/ s/^#//' /etc/libvirt/qemu.conf
sudo sed -i 's/libvirt-qemu/asainz/' /etc/libvirt/qemu.conf
sudo systemctl enable libvirtd
# Install nvm
cd ~/tmp
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# The next command will not work until you close the terminal and open a new one
# Alternatively, you can source the corresponding shell init file
source ~/.bashrc
# source ~/.zshrc
nvm install --lts
cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment