-
Notifications
You must be signed in to change notification settings - Fork 1
/
installer
executable file
·89 lines (70 loc) · 3.34 KB
/
installer
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
#!/bin/bash
red='\033[0;31m'
green='\033[0;32m'
purple='\033[0;35m'
normal='\033[0m'
_w() {
local -r text="${1:-}"
echo -e "$text"
}
_a() { _w " > $1"; }
_e() { _a "${red}$1${normal}"; }
_s() { _a "${green}$1${normal}"; }
_q() { read -rp "🤔 $1: " "$2"; }
_w " ┌──────────────────────────────────────────┐"
_w "~ │ 🚀 Welcome to the ${green}dotfiles${normal} installer! │ ~"
_w " └──────────────────────────────────────────┘"
_w
_q "Confirm to install dotfiles (default ~/.dotfiles)" INSTALL_PATH
INSTALL_PATH=${INSTALL_PATH:-~/.dotfiles}
[ ! -d $INSTALL_PATH ] && git clone https://github.com/frandieguez/.dots.git $INSTALL_PATH
cd $INSTALL_PATH
cargo install docpars
export PATH=$HOME/.cargo/bin:$PATH
_a "Initializing submodules…"
git submodule update --init --recursive
_a "Installing dotly…"
DOTFILES_PATH="$INSTALL_PATH" DOTLY_PATH="$INSTALL_PATH/modules/dotly" "$INSTALL_PATH/modules/dotly/bin/dot" self install
DOTFILES_PATH="$INSTALL_PATH" DOTLY_PATH="$INSTALL_PATH/modules/dotly" "$INSTALL_PATH/modules/dotly/bin/dot" symlinks apply
_a "Initializing zsh and zimfw…"
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \
https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
fi
zsh $INSTALL_PATH/modules/dotly/modules/zimfw/zimfw.zsh install
_a "Installing system packages…"
DOTFILES_PATH="$INSTALL_PATH" DOTLY_PATH="$INSTALL_PATH/modules/dotly" "$INSTALL_PATH/modules/dotly/bin/dot" package import
_a "Initializing vim…"
curl -fLo $HOME/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim &> /dev/null
_a "Installing k9s skin…"
curl -q https://raw.githubusercontent.com/derailed/k9s/master/skins/stock.yml --output ~/.k9s/skin.yml &> /dev/null
_a "Installing git…"
if [ "`grep user $HOME/.gitconfig-additional`" == "" ]; then
_q "Do you want to add your credentials to your .gitconfig? (Y/n) " q
if [ "$q" == "Y" ] || [ "$q" == "y" ] || [ "$q" == "" ]; then
_q "Name" username
_q "Email" email
echo "[user]" >> $HOME/.gitconfig-additional
echo " name = " $username >> $HOME/.gitconfig-additional
echo " email = " $email >> $HOME/.gitconfig-additional
fi
fi
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
_a "Installing archlinux packages…" &&
grep -v '#' ./os/linux/archlinux-packages | xargs yay -S --noconfirm --needed
_a "Installing fonts…"
sudo ln -s /usr/share/fontconfig/conf.avail/10-nerd-font-symbols.conf /etc/fonts/conf.d/10-nerd-font-symbols.conf
_a "Installing user services…"
# Enable gnome keyring
systemctl enable --now --user gcr-ssh-agent.service
systemctl enable --now --user gnome-keyring-daemon.service
fi
if [[ $OSTYPE =~ ^[darwin] ]]; then
_w "Installing brew package manager for macOS 💾"
(! which brew) && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
_a "Installing archlinux packages…" &&
grep -v '#' ./os/mac/brew-packages | xargs brew install
fi
_w "🎉 dotfiles installed correctly! 🎉"
_w "Please, restart your terminal to see the changes"