dotfiles/jumpstart.sh

53 lines
1.2 KiB
Bash
Raw Normal View History

2022-12-30 11:51:39 -08:00
#!/usr/bin/env bash
echo -e "Starting initial setup..."
CHEZDIR="/home/test/.local/share/chezmoi"
2022-12-30 11:51:39 -08:00
echo "Input email for bitwarden:"
read bitemail
# Install ansible python dependencies
sudo xbps-install -Syu -y
sudo xbps-install python3 python3-pip ansible -y
2022-12-30 11:51:39 -08:00
sudo pip install pexpect
# Install ansible extensions
ansible-galaxy install -r "$CHEZDIR/provision/requirements.yml"
# Run setup playbook
ansible-playbook "$CHEZDIR/provision/setup.yml" -i "$CHEZDIR/provision/hosts" --ask-become-pass
2023-01-01 10:55:58 -08:00
export PATH="$PATH:/usr/local/bin"
2022-12-30 11:51:39 -08: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"
export PATH="$PATH:$CHEZDIR/temp_bin"
# Set bitwarden email
rbw config set email "$bitemail"
# Make temporary i3 gen file
mkdir -p "$CHEZDIR/home/.gen"
echo "{
\"disp_pri\": \"HDMI-0\",
\"disp_sec\": \"HDMI-0\"
}" > "$CHEZDIR/home/.gen/i3.json"
2023-01-01 10:55:58 -08:00
# initialize chezmoi
chezmoi init
2022-12-30 11:51:39 -08:00
# first chezmoi apply
chezmoi apply
# 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