-
Notifications
You must be signed in to change notification settings - Fork 1
/
quick-install.sh
executable file
·67 lines (57 loc) · 1.62 KB
/
quick-install.sh
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
#!/run/current-system/sw/bin/bash
# SCR
SCR="$HOME/GitHub/mine/scripts"
NS="$SCR/nixos-scripts"
OZ="$HOME/.oh-my-zsh"
ZT="$SCR/zsh-theme"
FUS_URL="https://github.com/fusion809"
ZSH_URL="https://github.com/zsh-users"
# Create GitHub directory
if ! [[ -d $SCR ]]; then
mkdir -p $SCR
fi
# Get openssh, if not pre-installed and Zsh
sudo nix-env -i openssh zsh git
# Clone nixos-scripts repo
if ! [[ -d $NS ]]; then
git clone $FUS_URL/nixos-scripts $NS
# Copy across
cp -a $NS/{Shell,.bashrc,.zshrc} $HOME/
sudo cp -a $NS/root/{Shell,.bashrc,.zshrc} /root/
else
cd $NS
git pull origin master
cd -
# Copy across
cp -a $NS/{Shell,.bashrc,.zshrc} $HOME/
sudo cp -a $NS/root/{Shell,.bashrc,.zshrc} /root/
fi
if ! [[ -d $HOME/.oh-my-zsh ]]; then
# git clone oh-my-zsh
git clone https://github.com/robbyrussell/oh-my-zsh $OZ
else
cd $OZ
git pull origin master
cd -
fi
if ! [[ -d $ZT ]]; then
# Get my self-made zsh-themes
git clone https://github.com/fusion809/zsh-theme $ZT
cp -a $ZT/*.zsh-theme $OZ/themes/
else
cd $HOME/GitHub/{,mine/}zsh-theme
git pull origin master
cd -
cp -a $HOME/GitHub/{,mine/}zsh-theme/*.zsh-theme $OZ/themes/
fi
if ! [[ -d $OZ/plugins/zsh-syntax-highlighting ]]; then
# Get zsh-syntax-highlighting
git clone $ZSH_URL/zsh-syntax-highlighting $OZ/plugins/zsh-syntax-highlighting
fi
if ! [[ -d $OZ/plugins/zsh-history-substring-search ]]; then
git clone $ZSH_URL/zsh-history-substring-search $OZ/plugins/zsh-history-substring-search
fi
# Change default login shell to Zsh
chsh -s /run/current-system/sw/bin/zsh
sudo chsh -s /run/current-system/sw/bin/zsh
/run/current-system/sw/bin/zsh