blob: 5d7b856454bc162a21a9e76bf213006f783edd32 (
plain)
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
MODULES=xmodmap emacs xdg shepherd dunst zsh mcron mbsync nyxt work \
herbstluftwm mpd polybar xbindkeys firefox
STOW = stow
EMACS = emacs
SCHEME_IMPLEMENTATION = guile
.PRECIOUS: %.el
define tangle =
@printf "\e[35mOBT\e[0m %s\n" $<
@$(EMACS) -quick -batch \
-eval "(package-initialize)" \
-load ob-tangle \
-eval "(setq sh-make-vars-local nil)" \
-eval "(setq geiser-default-implementation '$(SCHEME_IMPLEMENTATION))" \
-eval "(org-babel-tangle-file \"$<\" \"$(PWD)/$@\" \"$(1)\")"
endef
.PHONY: all clean $(MODULES) zsh
all: $(MODULES)
install: $(addsuffix -stow,$(MODULES))
clean: $(addsuffix -clean,$(MODULES))
before-%-install: # Dummy recipe
@true
%-stow: % before-%-install
$(STOW) $<
%-install: %-stow # Dummy recipe
@true
%-uninstall:
$(STOW) -D $(subst -uninstall,,$@)
## Picom
picom: picom/.config/picom.conf
picom/.config/picom.conf: picom/.config/picom.org
$(call tangle,conf)
picom-clean:
rm -f picom/.config/picom.conf
## Emacs
before-emacs-install: emacs/.emacs.d/init.elc
emacs-clean:
rm -f emacs/.config/shepherd/init.d/emacs.scm emacs/.emacs.d/init.el \
emacs/.emacs.d/init.elc
## Xmodmap
xmodmap: xmodmap/.Xmodmap
xmodmap-clean:
rm -f xmodmap/.Xmodmap
## Cower
cower: cower/.config/cower/config
cower/.config/cower/config: cower/.config/cower/config.org
$(call tangle,conf-unix)
cower-clean:
rm -f cower/.config/cower/config
## Mowedline
mowedline: mowedline/.config/mowedline/init.scm
mowedline/.config/mowedline/init.scm: SCHEME_IMPLEMENTATION = chicken
mowedline/.config/mowedline/init.scm: mowedline/.config/mowedline/init.org
$(call tangle,scheme)
mowedline-clean:
rm -f mowedline/.config/mowedline/init.scm
## Dunst
dunst: dunst/.config/dunst/dunstrc dunst/.config/shepherd/init.d/dunst.scm
## X11
x11-install: lib-install x11/dot-x11-0-1-any.pkg.tar.xz
x11/dot-x11-0-1-any.pkg.tar.xz: x11/PKGBUILD
cd x11 && makepkg -sicf
## XDG
xdg: xdg/.config/mimeapps.list xdg/.config/user-dirs.dirs \
xdg/.config/user-dirs.locale
# These files shouldn't be stowed because the applications managing/using them
# immediately replace the symbolic links with new files and the settings in them
# are lost.
xdg-stow:
cp xdg/.config/mimeapps.list xdg/.config/user-dirs.dirs xdg/.config/user-dirs.locale $(HOME)/.config/
## Shepherd
shepherd: shepherd/.config/shepherd/init.scm
## Mcron
mcron: mcron/.config/shepherd/init.d/mcron.scm
## Mbsync
mbsync: mbsync/.config/cron/mbsync.guile
## ZSH
zsh: zsh/.profile zsh/.zshrc zsh/.zsh/functions/unzip.zwc \
zsh/.zsh/functions/x-yank.zwc zsh/.zsh/functions/x-copy-region-as-kill.zwc
## Nyxt
nyxt: nyxt/.config/nyxt/init.lisp
## Helper
%.el: %.org
$(call tangle,emacs-lisp)
%.elc: %.el
@printf "\e[36mELC\e[0m %s\n" $<
@$(EMACS) -q -batch -f package-initialize -f batch-byte-compile $<
%.fnl: %.org
$(call tangle,fennel)
%.lua: %.fnl
@printf "\e[32mFNL\e[0m %s\n" $<
@fennel --compile $^ > $@
%: %.org
$(call tangle)
.%: %.org
$(call tangle)
%.zwc: %
zsh -c "zcompile $@ $^"
check:
$(SCHEME_IMPLEMENTATION) --no-auto-compile test.scm
$(HOME)/code/%/:
mkdir -p $@
new-dotfiles:
## Surfingkeys
surfingkeys/dist/home.js: surfingkeys/home.ts
surfingkeys/dist/punt.js: surfingkeys/punt.ts surfingkeys/home.ts
cd surfingkeys && guix shell nodejs -- npx webpack -c webpack.config.js
## Diamond Interactive MacOS
diamond-interactive: ssh-keygen brew-install wezterm-install glide-install git-install zsh-install _mbsetupuser-install change-macos-defaults
ssh-keygen: $(HOME)/.ssh/id_ed25519.pub
$(HOME)/.ssh/id_ed25519.pub:
ssh-keygen -t ed25519 -C "Tom Punt Macos Laptop"
brew-install: _mbsetupuser/Brewfile
brew bundle --quiet --file $^
before-_mbsetupuser-install: \
_mbsetupuser/.emacs.d/init.elc \
_mbsetupuser/.emacs.d/scripts/find-php-class
before-wezterm-install: wezterm/.config/wezterm/wezterm.lua
_mbsetupuser/.config/zsh/conf.d/postgresql.sh: _mbsetupuser/Brewfile
$(call tangle,shell)
_mbsetupuser/.emacs.d/init.el: \
emacs/.emacs.d/init.el \
emacs/.emacs.d/oni-outline.el \
emacs/.emacs.d/oni-gui.el \
emacs/.emacs.d/oni-dashboard.el \
emacs/.emacs.d/oni-stillness.el \
emacs/.emacs.d/oni-xterm-color.el \
emacs/.emacs.d/oni-compilation.el \
emacs/.emacs.d/oni-php.el \
emacs/.emacs.d/oni-prescient.el \
emacs/.emacs.d/oni-corfu.el \
emacs/.emacs.d/oni-yasnippet.el \
emacs/.emacs.d/oni-smartparens.el \
emacs/.emacs.d/oni-flycheck.el \
emacs/.emacs.d/oni-dumb-jump.el \
emacs/.emacs.d/oni-grep.el \
oni/home/config/pop-os/emacs.el
mkdir -p $$(dirname $@)
cat $^ > $@
_mbsetupuser/.emacs.d/scripts/%: emacs/.emacs.d/scripts/%
mkdir -p $$(dirname $@)
cp $^ $@
project-directories: \
$(HOME)/code/personal/ \
$(HOME)/code/diamond-interactive/ \
$(HOME)/code/foreign/ \
$(HOME)/code/study/
change-macos-defaults:
# https://macos-defaults.com/dock/autohide.html
defaults write com.apple.dock "autohide" -bool "true"
killall Dock
# Local Variables:
# outline-regexp: "##+"
# End:
|