Update .scripts/install_base.sh

This commit is contained in:
V 2022-12-10 03:50:27 +04:00
parent adad37ec41
commit fee815d63e

View file

@ -4,25 +4,32 @@
# seriously, don't do this, it's insecure!
## Pacman
echo ":enable multilib"
echo "* enable multilib"
sudo sed -z -i -e 's/#\[multilib\]\n#Include = \/etc\/pacman.d\/mirrorlist/\[multilib\]\nInclude = \/etc\/pacman.d\/mirrorlist/' /etc/pacman.conf
# Workaround for keyring nonsense, see https://bugs.archlinux.org/task/75574
echo "* refresh pkg db, update keyring"
sudo pacman -Sy --needed --noconfirm archlinux-keyring
echo "* upgrade installed pkgs"
sudo pacman -Su --needed --noconfirm
# Install packages
echo "* install pkgs"
sudo pacman --needed --noconfirm -S base-devel htop ranger git screen ncdu neovim pipewire sway swaybg xorg-server xorg-xwayland chezmoi foot polkit openssh firefox-developer-edition gnome-keyring xdg-utils qpwgraph qt6-wayland man-db udisks2 ttf-cascadia-code ponysay lm_sensors wget fish mosh jq pkgfile reflector
# Fire reflector (should probably call it there directly with custom config)
echo "* run reflector"
sudo systemctl start reflector
# Sync pkgfile db
echo "* sync pkgfile"
sudo pkgfile -u
## Paru (AUR helper)
# Install Paru from AUR if not installed
if pacman -Qs paru > /dev/null ; then
echo "'Paru' already installed."
echo "* paru already installed."
else
echo "* install paru"
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin/
makepkg --needed --noconfirm -si
@ -31,17 +38,18 @@ else
fi
## AUR Packages
echo "* install AUR pkgs"
paru --needed --noconfirm -Syua paru-bin bashmount ulauncher localepurge
if ! pacman -Qi nvim-packer-git > /dev/null; then
paru -S --needed --noconfirm nvim-packer-git
fi
# Remove orphans
echo "* remove orphans"
paru -Qtdq | paru --noconfirm -Rns -
## Chezmoi
# Get and apply dotfiles
echo "* init chezmoi"
chezmoi init --apply https://inex.dev/v/dotfiles.git
cd ~/.local/share/chezmoi/
git remote set-url origin git@inex.dev:v/dotfiles.git
@ -50,24 +58,28 @@ cd ~
## SSH
# Generate key if not exist
if [ -f "$HOME/.ssh/id_ed25519.pub" ]; then
echo "id_ed25519.pub exist"
echo "* ssh key already exist"
else
echo "creating id_ed25519.pub..."
echo "* create ssh key"
ssh-keygen -t ed25519 -f "$HOME/.ssh/id_ed25519" -N ""
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
fi
## Neovim
echo "* install/upgrade nvim pkgs"
nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
## Add user to useful groups
echo "* add user to groups"
sudo usermod -aG wheel,input,audio,video,lp v
## Apply Firefox policies, see https://github.com/mozilla/policy-templates/blob/master/README.md
echo "* set firefox policies"
sudo mkdir -p /etc/firefox/policies
sudo cp ~/.scripts/firefox_policies.json /etc/firefox/policies/policies.json
## Fix NTFS Mount, see https://wiki.archlinux.org/title/NTFS#udisks_support
echo "* set mount options"
sudo cp ~/.scripts/mount_options.conf /etc/udisks2/mount_options.conf