-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·41 lines (32 loc) · 1.18 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·41 lines (32 loc) · 1.18 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
#!/bin/bash
if ! command -v nix &> /dev/null; then
echo "* Installing Nix..."
curl -L https://nixos.org/nix/install | sh
. ~/.nix-profile/etc/profile.d/nix.sh
fi
echo "* Setting vim and zsh configurations..."
# Set vimrc
cp default.vimrc ~/.vimrc
# Set a default zshrc
cp default.zshrc ~/.zshrc.default
# Install zsh syntax highlighting
if [ ! -d ~/.installs/zsh-syntax-highlighting ]; then
echo "* Installing zsh syntax highlighting..."
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
mkdir -p ~/.installs
mv zsh-syntax-highlighting ~/.installs
fi
# Add sourcing zsh syntax highlighting to default zshrc
echo "" >> ~/.zshrc.default
echo "# Zsh syntax highlighting" >> ~/.zshrc.default
echo "source ~/.installs/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc.default
echo "" >> ~/.zshrc.default
# Source the default zshrc
if [ ! -f ~/.zshrc ] || ! grep -Fxq ". ~/.zshrc.default" ~/.zshrc; then
echo "# Source default zshrc" >> ~/.zshrc
echo ". ~/.zshrc.default" >> ~/.zshrc
fi
# Add script to open nix-shell
echo "nix-shell $PWD/shell.nix" > ~/.open_default_nix_shell.sh
echo "* Everything is configured!"
nix-shell $PWD/shell.nix