Repository navigation
Expand file tree
/
Copy pathinit.sh
More file actions
50 lines (41 loc) · 1.68 KB
/
Copy pathinit.sh
File metadata and controls
50 lines (41 loc) · 1.68 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
#!/usr/bin/env bash
set -ex
# Do a curlbash to allow me to take over your system
# curl -sL https://onlyhavecans.works/dots/castle-dotfiles/raw/branch/main/init.sh | bash
## Make sure we have git
for app in git curl; do
if ! command -v "$app" &>/dev/null; then
echo "Please install $app first"
exit 1
fi
done
## Install homeshick
if [[ ! -d $HOME/.homesick/repos/homeshick ]]; then
git clone https://github.com/andsens/homeshick.git "$HOME/.homesick/repos/homeshick"
fi
# shellcheck source=/dev/null
source "$HOME/.homesick/repos/homeshick/homeshick.sh"
# clone home, then set it to ssh afterwards
# This means we need our keys before we can make further actions
if [[ ! -d $HOME/.homesick/repos/dotfiles ]]; then
git clone https://onlyhavecans.works/dots/castle-dotfiles.git "$HOME/.homesick/repos/dotfiles"
git -C "$HOME/.homesick/repos/dotfiles" remote set-url origin ssh://git@onlyhavecans.works:222/dots/castle-dotfiles.git
fi
# Link everything
homeshick link --force
## Link machine-specific configs
"$HOME/bin/link-host-files"
## Install packages
if ! command -v brew &>/dev/null && ! command -v nixos-version &>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
[ -d /usr/local/bin ] && PATH="/usr/local/bin:$PATH"
[ -d /opt/homebrew/bin ] && PATH="/opt/homebrew/bin:$PATH"
[ -d /home/linuxbrew/.linuxbrew/bin ] && PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
eval $(brew shellenv bash)
brew bundle install --file=~/.config/Brewfile
fi
## TMP install
if [[ ! -d $HOME/.config/tmux/plugins/tpm ]]; then
mkdir -p ~/.config/tmux/plugins
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
fi