-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
181 lines (136 loc) · 5.1 KB
/
Makefile
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
########################################################
## General variables
DOTFILES := $(shell pwd)
VIMPLUG := https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
SPACEMACS := https://github.com/syl20bnr/spacemacs
DOOM := https://github.com/hlissner/doom-emacs
BASE16 := https://github.com/chriskempson/base16-shell.git
TPM := https://github.com/tmux-plugins/tpm
PANDOCMINTED := https://github.com/nick-ulle/pandoc-minted.git
FISHERMAN := https://git.io/fisher
STARFISH := https://starship.rs/install.sh
PYENV := https://github.com/pyenv/pyenv.git
PYENV_UPDATE := git://github.com/pyenv/pyenv-update.git
.PHONY: emacs vim fish bash git fonts pacaur tmux alacritty pandoc pyenv clean-*
########################################################
## Main recipes
all: no-emacs emacs
no-emacs: nvim fish bash git fonts tmux alacritty pandoc pyenv
clean: clean-*
reset: clean all
########################################################
## Emacs recipes
emacs: emacs-doom
emacs-spacemacs: clean-emacs-doom
ln -fs $(DOTFILES)/emacs/spacemacs $(HOME)/.spacemacs
git clone $(SPACEMACS) $(HOME)/.emacs.d/ --branch develop
rm -rf $(HOME)/.emacs.d/private/snippets
ln -fs $(DOTFILES)/emacs/snippets $(HOME)/.emacs.d/private
emacs-doom: clean-emacs-spacemacs
-rm -r $(HOME)/.doom.d.bak
-mv $(HOME)/.doom.d $(HOME)/.doom.d.bak
ln -fs $(DOTFILES)/emacs/doom $(HOME)/.doom.d
-git clone $(DOOM) $(HOME)/.emacs.d/ --branch develop
cd $(HOME)/.emacs.d && bin/doom install
clean-emacs: clean-emacs-spacemacs clean-emacs-doom
clean-emacs-spacemacs:
-systemctl --user disable --now emacs.service
-rm $(HOME)/.spacemacs
-rm $(HOME)/.emacs.d/private/snippets
-rm -rf $(HOME)/.emacs.d
clean-emacs-doom:
-rm -rf $(HOME)/.doom.d
-rm -rf $(HOME)/.emacs.d
########################################################
## Vim recipes
vim:
ln -fs $(DOTFILES)/vim/vimrc $(HOME)/.vimrc
curl -fLo $(HOME)/.vim/autoload/plug.vim --create-dirs $(VIMPLUG)
clean-vim:
-rm $(HOME)/.vimrc
-rm -rf $(HOME)/.vim
########################################################
## Neovim recipes
nvim:
mkdir -p $(HOME)/.config/nvim
ln -fs $(DOTFILES)/vim/vimrc $(HOME)/.config/nvim/init.vim
curl -fLo $(HOME)/.config/nvim/autoload/plug.vim --create-dirs $(VIMPLUG)
clean-nvim:
-rm $(HOME)/.config/nvim/init.vim
-rm -rf $(HOME)/.config/nvim
########################################################
## Pandoc recipes
pandoc:
mkdir -p $(HOME)/.pandoc/templates
ln -fs $(DOTFILES)/pandoc/class.tex $(HOME)/.pandoc/templates/class.tex
git clone $(PANDOCMINTED) $(HOME)/.local/bin/pandoc-filters/pandoc-minted
ln -fs $(HOME)/.local/bin/pandoc-filters/pandoc-minted/pandoc-minted.py $(HOME)/.local/bin/pandoc-minted
clean-pandoc:
-rm -r $(HOME)/.pandoc
-rm $(HOME)/.local/bin/pandoc-minted
-rm -rf $(HOME)/.local/bin/pandoc-filters
########################################################
## Pyenv recipes
pyenv:
git clone $(PYENV) $(HOME)/.pyenv
git clone $(PYENV_UPDATE) $(HOME)/.pyenv/plugins/pyenv-update
clean-pyenv:
-rm -rf $(HOME)/.pyenv
########################################################
## Fish recipes
fish: _common-shell
mkdir -p $(HOME)/.config/fish/functions
ln -fs $(DOTFILES)/fish/config.fish $(HOME)/.config/fish/config.fish
curl -Lo $(HOME)/.config/fish/functions/fisher.fish --create-dirs $(FISHERMAN)
ln -fs $(DOTFILES)/fish/fishfile $(HOME)/.config/fish/fishfile
-mkdir -p $(HOME)/.local/bin
-fish -c fisher
sh -c "curl -fsSL $(STARFISH_CMD)"
ln -fs $(DOTFILES)/fish/starship.toml $(HOME)/.config/starship.toml
clean-fish: _clean-shell
-rm $(HOME)/.config/fish/config.fish
-rm -rf $(HOME)/.config/fish/functions
-rm "$(which starship)"
########################################################
## Bash recipes
bash: _common-shell
-mv -f $(HOME)/.bashrc $(HOME)/.bashrc.bak
ln -fs $(DOTFILES)/bash/bashrc $(HOME)/.bashrc
clean-bash: _clean-shell
-rm $(HOME)/.bashrc
-mv $(HOME)/.bashrc.bak $(HOME)/.bashrc
########################################################
## Gitconfig recipes
git:
ln -fs $(DOTFILES)/git/gitconfig $(HOME)/.gitconfig
clean-git:
-rm $(HOME)/.gitconfig
########################################################
## Fonts recipes
fonts:
ln -fs $(DOTFILES)/fonts/.Xresources $(HOME)/.Xresources
clean-fonts:
-rm $(HOME)/.Xresources
#########################################################
## Tmux recipes
tmux:
ln -fs $(DOTFILES)/tmux/tmux.conf $(HOME)/.tmux.conf
git clone $(TPM) $(HOME)/.tmux/plugins/tpm
clean-tmux:
-rm $(HOME)/.tmux.conf
-rm -r $(HOME)/.tmux/
#########################################################
## Alacritty recipes
alacritty:
mkdir -p $(HOME)/.config/alacritty
-mv $(HOME)/.config/alacritty/alacritty.yml $(HOME)/.config/alacritty/alacritty.yml.bak
ln -fs $(DOTFILES)/alacritty/alacritty.yml $(HOME)/.config/alacritty/alacritty.yml
clean-alacritty:
-rm $(HOME)/.config/alacritty/alacritty.yml
-mv $(HOME)/.config/alacritty/alacritty.yml.bak $(HOME)/.config/alacritty/alacritty.yml
#########################################################
## Not directly used recipes
_common-shell:
-git clone $(BASE16) $(HOME)/.config/base16-shell
_clean-shell:
-rm -rf $(HOME)/.config/base16-shell