dotfiles/dot_scripts/executable_install_base.sh

65 lines
2.3 KiB
Bash
Raw Normal View History

2022-11-24 16:04:55 +00:00
#!/bin/sh
2022-11-24 16:11:50 +00:00
# Never ever curl some remote shit straight to shell, like:
2022-11-25 16:58:51 +00:00
# curl --proto '=https' --tlsv1.2 -sSf https://inex.dev/v/dotfiles/raw/branch/main/dot_scripts/executable_install_base.sh | sh
2022-11-25 22:16:04 +00:00
# seriously, don't do this, it's insecure!
2022-11-24 16:04:55 +00:00
2022-12-01 13:22:28 +00:00
## Pacman
2022-12-01 17:42:43 +00:00
# Enable multilib
2022-12-01 19:32:02 +00:00
sudo sed -z -i -e 's/#\[multilib\]\n#Include = \/etc\/pacman.d\/mirrorlist/\[multilib\]\nInclude = \/etc\/pacman.d\/mirrorlist/' /etc/pacman.conf
2022-12-01 13:22:28 +00:00
# Workaround for keyring nonsense, see https://bugs.archlinux.org/task/75574
2022-12-01 13:25:29 +00:00
sudo pacman -Sy --needed --noconfirm archlinux-keyring
sudo pacman -Su --needed --noconfirm
2022-12-01 13:22:28 +00:00
# Install packages
2022-12-04 13:43:34 +00:00
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
2022-11-24 16:04:55 +00:00
2022-12-01 13:22:28 +00:00
## Paru (AUR helper)
# Install Paru from AUR if not installed
2022-11-24 16:04:55 +00:00
if pacman -Qs paru > /dev/null ; then
echo "'Paru' already installed."
else
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin/
makepkg --needed --noconfirm -si
cd ..
rm -rf paru-bin/
fi
2022-12-01 13:22:28 +00:00
## AUR Packages
2022-12-03 20:24:30 +00:00
paru --needed --noconfirm -Syua paru-bin bashmount ulauncher
if ! pacman -Qi nvim-packer-git > /dev/null; then
2022-12-03 20:25:49 +00:00
paru -S --needed --noconfirm nvim-packer-git
2022-12-03 20:24:30 +00:00
fi
2022-11-24 16:51:15 +00:00
2022-12-01 13:22:28 +00:00
## Chezmoi
# Get and apply dotfiles
2022-11-24 16:51:15 +00:00
chezmoi init --apply https://inex.dev/v/dotfiles.git
2022-12-01 19:33:03 +00:00
cd ~/.local/share/chezmoi/
2022-11-25 16:49:34 +00:00
git remote set-url origin git@inex.dev:v/dotfiles.git
2022-12-01 19:33:03 +00:00
cd ~
2022-11-24 16:51:15 +00:00
2022-12-01 13:22:28 +00:00
## SSH
# Generate key if not exist
2022-11-24 17:17:39 +00:00
if [ -f "$HOME/.ssh/id_ed25519.pub" ]; then
echo "id_ed25519.pub exist"
else
echo "creating id_ed25519.pub..."
2022-11-24 17:20:28 +00:00
ssh-keygen -t ed25519 -f "$HOME/.ssh/id_ed25519" -N ""
2022-11-24 17:17:39 +00:00
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
fi
2022-12-03 17:47:56 +00:00
## Neovim
2022-12-03 20:41:07 +00:00
nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
2022-12-03 17:47:56 +00:00
2022-12-01 13:22:28 +00:00
## Add user to useful groups
sudo usermod -aG wheel,input,audio,video,lp v
2022-12-01 13:22:28 +00:00
2022-12-01 19:31:21 +00:00
## Apply Firefox policies, see https://github.com/mozilla/policy-templates/blob/master/README.md
2022-11-25 21:16:08 +00:00
sudo mkdir -p /etc/firefox/policies
2022-12-01 19:33:03 +00:00
sudo cp ~/.scripts/firefox_policies.json /etc/firefox/policies/policies.json
2022-12-01 19:31:21 +00:00
## Fix NTFS Mount, see https://wiki.archlinux.org/title/NTFS#udisks_support
2022-12-01 19:33:03 +00:00
sudo cp ~/.scripts/mount_options.conf /etc/udisks2/mount_options.conf
2022-12-01 13:22:28 +00:00