dotfiles/provision/arch/jumpstart.sh

51 lines
1.2 KiB
Bash
Raw Normal View History

2023-07-03 16:57:11 -07:00
#!/usr/bin/env bash
2023-07-05 08:18:25 -07:00
echo -e "Starting initial setup for Arch..."
2023-07-03 16:57:11 -07:00
CHEZDIR="$HOME/.local/share/chezmoi"
echo "Input email for bitwarden:"
read bitemail
# Install ansible python dependencies
2023-07-05 08:18:25 -07:00
sudo pacman -Syu
2023-07-05 08:43:13 -07:00
sudo pacman -Syu python3 python-pip ansible cargo
sudo find / -name "EXTERNALLY-MANAGED" -type f -delete
2023-07-03 21:37:37 -07:00
pip install pexpect
2023-07-03 16:57:11 -07:00
cargo install rbw
# Add things to path for this script
2023-07-03 23:45:48 -07:00
mkdir -p $HOME/.local/bin
2023-07-03 16:57:11 -07:00
export PATH="$PATH:/usr/local/bin"
export PATH="$PATH:$HOME/.cargo/bin"
export PATH="$PATH:$CHEZDIR/temp_bin"
2023-07-03 23:45:48 -07:00
export PATH="$PATH:$HOME/.local/bin"
2023-07-03 16:57:11 -07:00
# Install ansible extensions
2023-07-05 08:43:13 -07:00
ansible-galaxy install -r "$CHEZDIR/provision/arch/ansible/requirements.yml"
2023-07-03 16:57:11 -07:00
# Run setup playbook
2023-07-05 08:43:13 -07:00
ansible-playbook "$CHEZDIR/provision/arch/ansible/setup.yml" -i "$CHEZDIR/provision/arch/ansible/hosts" --ask-become-pass
2023-07-03 16:57:11 -07:00
# Copy jumpstart scripts to temp bin dir and add to path
mkdir -p "$CHEZDIR/temp_bin"
cp "$CHEZDIR/home/bin/executable_rbw-get" "$CHEZDIR/temp_bin/rbw-get"
chmod +x "$CHEZDIR/temp_bin/rbw-get"
# Set bitwarden email
rbw config set email "$bitemail"
2023-07-05 11:33:00 -07:00
# initialize chezmoi
chezmoi init
# first chezmoi apply
chezmoi apply
2023-07-03 16:57:11 -07:00
# reboot!
read -p "You should reboot, but I won't make you. Reboot? " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
sudo reboot