-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprovision
More file actions
executable file
·128 lines (97 loc) · 3.26 KB
/
Copy pathprovision
File metadata and controls
executable file
·128 lines (97 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
source ./helpers
host_font_dir="$HOME/.local/share/fonts"
host_org_notes_dir="$HOME/notes/tome"
host_work_dirs=("$HOME/work/priming" "$HOME/work/sandbox" "$HOME/work/projects")
stow_font_dir="fonts"
non_base_config=("_deskmod" ".git" "$stow_font_dir")
declare -a de=()
if [[ $EUID -eq 0 ]]; then
printf "Please run as normal user.\n" >&2
exit 1
fi
spinner "\nInitiating system provisioning... "
echo -e "Script requires sudo privileges for package installation"
sudo -p "Input password for sudo: " printf "" || exit 1
spinner "\nInitiating installation of GNU stow.. "
yes | sudo pacman -S stow
echo -e "\nGNU stow installation successful\n"
spinner "Initiating configuration stow for base applications... "
for dir in */; do
dir=$(echo "$dir" | sed 's/\/*$//g')
if [[ ! ${non_base_config[@]} =~ $dir ]]; then
echo "Stowing configurations for $dir..."
stow -vv "$dir"
fi
done
spinner "\nCreating fonts directory... "
mkdir -p "$host_font_dir"
echo -e "Font directory created at: $host_font_dir"
spinner "\nInitiating fonts stow and installation... "
for dir in "$stow_font_dir"/*; do
dir=$(basename $dir)
echo "Stowing font $dir..."
stow -vv -d "$stow_font_dir" -S "$dir" -t "$host_font_dir"
done
echo -e "\r"
fc-cache -fv
spinner "\nCreating org notes directory... "
mkdir -p "$host_org_notes_dir"
echo -e "Org notes directory created at: $host_org_notes_dir"
spinner "\nCreating work directories... "
for v in "${host_work_dirs[@]}"; do
mkdir -p "$v"
echo -e "Work directory created at: $v"
done
spinner "\nDetecting if yay is installed... "
if ! command -v yay &> /dev/null; then
spinner "\nInitiating installation of yay... "
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
yes | makepkg -si
rm -rf ../yay
echo -e "\nyay installation successful\n"
else
echo -e "yay installation detected\n"
fi
spinner "Installing rust..."
yes | yay -S rustup
# Set rustup version
echo -e "Setting rustup default version to stable...\n"
rustup default stable
echo -e "The following packages will be installed:\n"
sleep 2
cat packages_base.txt
start_spinner "\nPreparing installation of packages... "
sleep 6
stop_spinner
yay -Syu --needed --noconfirm - < packages_base.txt
spinner "\nInitializing installation of application settings... "
# Install VIM plugins
echo -e "Installing VIM plugins...\n"
vim +'PlugInstall --sync' +qa
# Install tmux plugins
echo -e "Installing tmux plugins...\n"
~/.tmux/plugins/tpm/scripts/install_plugins.sh
# Install doom emacs
echo -e "\nInstalling doom emacs...\n"
git clone --depth 1 https://github.com/doomemacs/doomemacs "$HOME/.emacs.d"
~/.emacs.d/bin/doom sync
# Set default shell
spinner "\nSetting default shell to zsh... "
chsh -s $(which zsh)
spinner "Initializing desktop environment installation... "
PS3="Select environment to install: "
for e in _deskmod/*; do
e="$(basename $e)"
de+=("$e")
done
select c in "${de[@]}"; do
[[ -n $c ]] || { echo "Invalid choice. Please try again." >&2; continue; }
break # valid choice was made; exit prompt.
done
spinner "\nInitializing installation for $c... "
#spinner "Stowing configurations for $c... "
#stow -vv -R -d ./_deskmod -S "$c" -t $HOME
"./_deskmod/$c/install.sh"