-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
541 lines (475 loc) · 16.5 KB
/
Copy pathTaskfile.yaml
File metadata and controls
541 lines (475 loc) · 16.5 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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
---
version: "3"
env:
XDG_CONFIG_HOME: "{{.HOME}}/.config"
XDG_CACHE_HOME: "{{.HOME}}/.cache"
XDG_DATA_HOME: "{{.HOME}}/.local/share"
XDG_RUNTIME_DIR: "{{.HOME}}/tmp/xdg_runtime"
################################################################################
tasks:
ensure_xdg:
desc: Ensure the XDG locations are present
silent: true
internal: true
cmds:
- mkdir -p {{.XDG_CONFIG_HOME}}
- mkdir -p {{.XDG_CACHE_HOME}}
- mkdir -p {{.XDG_DATA_HOME}}
- mkdir -p {{.XDG_RUNTIME_DIR}}
################################################################################
## Alacritty
alacritty:up:
desc: Installs/upgrades and configures the Alacritty terminal
vars:
ALACRITTY_APP: /Applications/Alacritty.app
cmds:
- "{{.ROOT_DIR}}/alacritty/install"
- ln -sfn {{.ROOT_DIR}}/alacritty {{.XDG_CONFIG_HOME}}/alacritty
# Install terminfo from the app bundle so $TERM=alacritty works inside tmux.
- mkdir -p {{.HOME}}/.terminfo/61
- cp {{.ALACRITTY_APP}}/Contents/Resources/61/alacritty {{.HOME}}/.terminfo/61/alacritty
- cp {{.ALACRITTY_APP}}/Contents/Resources/61/alacritty-direct {{.HOME}}/.terminfo/61/alacritty-direct
- defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
- defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
alacritty:down:
desc: Removes Alacritty configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/alacritty
- rm -f {{.HOME}}/.terminfo/61/alacritty
- rm -f {{.HOME}}/.terminfo/61/alacritty-direct
################################################################################
## ASDF
asdf:up:
desc: Configures the ASDF SDK manager
cmds:
- ln -sfn {{.ROOT_DIR}}/asdf {{.XDG_CONFIG_HOME}}/asdf
- cmd: asdf completion zsh > {{.ROOT_DIR}}/asdf/_asdf
ignore_error: true
asdf:down:
desc: Removes the ASDF configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/asdf
################################################################################
# Bash
bash:up:
desc: Configures the Bash shell
cmds:
- ln -sfn {{.ROOT_DIR}}/bash/.bash_profile {{.HOME}}/.bash_profile
- ln -sfn {{.ROOT_DIR}}/bash/.bashrc {{.HOME}}/.bashrc
bash:down:
desc: Removes Bash configuration
cmds:
- rm {{.HOME}}/.bash_profile
- rm {{.HOME}}/.bashrc
################################################################################
# Binaries
bin:up:
desc: Provisions local binaries
vars:
BIN_HOME: "{{.HOME}}/.local/bin"
cmds:
- mkdir -p {{.BIN_HOME}}
- ln -sf {{.ROOT_DIR}}/bin/* {{.BIN_HOME}}
################################################################################
# Docker
docker:up:
desc: Configures the Docker engine
cmds:
- ln -sfn {{.ROOT_DIR}}/docker {{.XDG_CONFIG_HOME}}/docker
- mkdir -p {{.XDG_CONFIG_HOME}}/docker/cli-plugins
- ln -sfn /opt/homebrew/opt/docker-buildx/bin/docker-buildx {{.XDG_CONFIG_HOME}}/docker/cli-plugins/docker-buildx
- cmd: docker completion zsh > {{.ROOT_DIR}}/docker/_docker
ignore_error: true
- cmd: colima completion zsh > {{.ROOT_DIR}}/docker/_colima
ignore_error: true
docker:down:
desc: Removes Docker configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/docker
################################################################################
# FD
fd:up:
desc: Configures fd
cmds:
- ln -sfn {{.ROOT_DIR}}/fd {{.XDG_CONFIG_HOME}}/fd
fd:down:
desc: Removes FD configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/fd
################################################################################
# FZF
fzf:up:
desc: Configures FZF fuzzy finder
vars:
FZF_HOME:
sh: brew --prefix
cmds:
- ln -sfn {{.ROOT_DIR}}/fzf {{.XDG_CONFIG_HOME}}/fzf
- "{{.FZF_HOME}}/opt/fzf/install --all --xdg --no-update-rc"
fzf:down:
desc: Removes FZF configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/fzf
################################################################################
# Gems
gem:up:
desc: Configures Rubygems
cmds:
- gem update --system
- gem update
- gem cleanup
gem:down:
desc: Removes Gems configuration
cmds:
- gem uninstall -aIx
################################################################################
# Git
git:up:
desc: Configures Git
cmds:
- ln -sfn {{.ROOT_DIR}}/git {{.XDG_CONFIG_HOME}}/git
git:down:
desc: Removes Git configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/git
################################################################################
## Ghostty
ghostty:up:
desc: Installs/upgrades and configures the Ghostty terminal
cmds:
- ln -sfn {{.ROOT_DIR}}/ghostty {{.XDG_CONFIG_HOME}}/ghostty
ghostty:down:
desc: Removes Ghostty configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/ghostty
################################################################################
# GNU binaries
gnu:up:
desc: Configures GNU binaries
cmds:
- ln -sfn {{.ROOT_DIR}}/gnu {{.XDG_CONFIG_HOME}}/gnu
gnu:down:
desc: Removes GNU binaries configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/gnu
################################################################################
# Golang
go:up:
desc: Configures the Golang development environment
cmds:
- ln -sfn {{.ROOT_DIR}}/golang {{.XDG_CONFIG_HOME}}/golang
- ln -sfn {{.ROOT_DIR}}/golang/golangci.yml {{.HOME}}/.golangci.yml
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install golang.org/x/tools/cmd/goimports@latest
- go install github.com/sbowman/xq@latest
- go install mvdan.cc/gofumpt@latest
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
- go install golang.org/x/vuln/cmd/govulncheck@latest
go:down:
desc: Removes Golang configuration
cmds:
- rm -f {{.HOME}}/.golangci.yml
- rm -rf {{.XDG_CONFIG_HOME}}/golang
################################################################################
# Helm
helm:up:
desc: Installs the Helm binary and configuration
cmds:
- ln -sfn {{.ROOT_DIR}}/helm {{.XDG_CONFIG_HOME}}/helm
- cmd: helm plugin install https://github.com/databus23/helm-diff
ignore_error: true
- cmd: helm completion zsh > {{.ROOT_DIR}}/helm/_helm
ignore_error: true
helm:down:
desc: Removes Helm configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/helm
################################################################################
# Homebrew
homebrew:up:
desc: Configures the Homebrew environment
cmds:
- |
# Transition from old whole-directory symlink to per-file symlinks
if [ -L "{{.XDG_CONFIG_HOME}}/homebrew" ]; then
rm "{{.XDG_CONFIG_HOME}}/homebrew"
fi
- mkdir -p {{.XDG_CONFIG_HOME}}/homebrew
- ln -sfn {{.ROOT_DIR}}/homebrew/aliases.zsh {{.XDG_CONFIG_HOME}}/homebrew/aliases.zsh
- cp -n {{.ROOT_DIR}}/homebrew/trust.json {{.XDG_CONFIG_HOME}}/homebrew/trust.json
homebrew:down:
desc: Removes Homebrew configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/homebrew
################################################################################
# Intellij
ideavim:up:
desc: Configures IdeaVIM
cmds:
- ln -sfn {{.ROOT_DIR}}/ideavim {{.XDG_CONFIG_HOME}}/ideavim
- defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false
ideavim:down:
desc: Removes IdeaVIM configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/ideavim
- defaults delete com.jetbrains.intellij ApplePressAndHoldEnabled -bool false
################################################################################
# K9S
k9s:up:
desc: Configures K9S
cmds:
- ln -sfn {{.ROOT_DIR}}/k9s {{.XDG_CONFIG_HOME}}/k9s
k9s:down:
desc: Removes K9S configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/k9s
################################################################################
# Kubernetes
kube:up:
desc: Configures the Kubernetes environment
cmds:
- ln -sfn {{.ROOT_DIR}}/kubernetes {{.XDG_CONFIG_HOME}}/kubernetes
# Regenerate the zsh completions from the installed binaries (prevents drift).
- cmd: kubectl completion zsh > {{.ROOT_DIR}}/kubernetes/_kubectl
ignore_error: true
- cmd: k3d completion zsh > {{.ROOT_DIR}}/kubernetes/_k3d
ignore_error: true
kube:down:
desc: Removes Kubernetes configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/kubernetes
################################################################################
# MacOS
# macos:up:
# desc: Configures MacOS
# cmds:
# - sudo cp {{.ROOT_DIR}}/macos/limit.maxfiles.plist /Library/LaunchDaemons/limit.maxfiles.plist
# - sudo cp {{.ROOT_DIR}}/macos/limit.maxproc.plist /Library/LaunchDaemons/limit.maxproc.plist
# macos:down:
# desc: Removes MacOS configuration
# cmds:
# - sudo rm -f /Library/LaunchDaemons/limit.maxfiles.plist
# - sudo rm -f /Library/LaunchDaemons/limit.maxproc.plist
################################################################################
# Markdown
markdown:up:
desc: Configures the Markdown linters
cmds:
- ln -sfn {{.ROOT_DIR}}/markdown {{.XDG_CONFIG_HOME}}/markdown
- ln -sf {{.ROOT_DIR}}/markdown/markdownlintrc.json {{.HOME}}/.markdownlintrc
markdown:down:
desc: Removes Markdown configuration
cmds:
- rm -f {{.HOME}}/.markdownlintrc
- npm uninstall -g markdown2confluence
################################################################################
# Node
node:up:
desc: Configures NodeJS
cmds:
- ln -sfn {{.ROOT_DIR}}/node {{.XDG_CONFIG_HOME}}/node
- mkdir -p {{.XDG_DATA_HOME}}/node
node:down:
desc: Removes NodeJS configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/node
- rm -rf {{.XDG_DATA_HOME}}/node
################################################################################
# NPM
npm:up:
desc: Configures NPM
cmds:
- ln -sfn {{.ROOT_DIR}}/npm {{.XDG_CONFIG_HOME}}/npm
- mkdir -p {{.XDG_CACHE_HOME}}/npm
- mkdir -p {{.XDG_DATA_HOME}}/npm
- mkdir -p {{.XDG_RUNTIME_DIR}}/npm
npm:down:
desc: Removes NPM configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/npm
- rm -rf {{.XDG_CACHE_HOME}}/npm
- rm -rf {{.XDG_DATA_HOME}}/npm
- rm -rf {{.XDG_RUNTIME_DIR}}/npm
################################################################################
# Neovim
nvim:up:
desc: Configures Neovim
cmds:
- ln -sfn {{.ROOT_DIR}}/nvim {{.XDG_CONFIG_HOME}}/nvim
- uv sync --project {{.ROOT_DIR}}/nvim
- npm install -g neovim
- gem install neovim
- gem install logger
nvim:down:
desc: Removes Neovim configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/nvim
- rm -rf {{.ROOT_DIR}}/nvim/.venv
- npm uninstall -g neovim
- gem uninstall neovim || true
- rm -rf {{.HOME}}/.vimrc_background
- rm -rf {{.XDG_DATA_HOME}}/nvim/lazy
################################################################################
# OpenTofu
opentofu:up:
desc: "Links OpenTofu configuration"
cmds:
- ln -sfn {{.ROOT_DIR}}/opentofu {{.XDG_CONFIG_HOME}}/opentofu
opentofu:down:
desc: "Removes OpenTofu configuration link"
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/opentofu
################################################################################
# OpenCode
opencode:up:
desc: Configures OpenCode and Claude Code
deps: [ensure_xdg]
cmds:
- ln -sfn {{.ROOT_DIR}}/opencode {{.XDG_CONFIG_HOME}}/opencode
- npm install --prefix {{.ROOT_DIR}}/opencode
- mkdir -p {{.HOME}}/.claude
- rm -rf {{.HOME}}/.claude/skills
- ln -sfn {{.ROOT_DIR}}/opencode/skills {{.HOME}}/.claude/skills
- rm -rf {{.HOME}}/.claude/agents
- ln -sfn {{.ROOT_DIR}}/claude/agents {{.HOME}}/.claude/agents
- ln -sfn {{.ROOT_DIR}}/opencode/AGENTS.md {{.HOME}}/.claude/CLAUDE.md
- ln -sfn {{.ROOT_DIR}}/claude/settings.json {{.HOME}}/.claude/settings.json
- ln -sfn {{.ROOT_DIR}}/claude/statusline-command.sh {{.HOME}}/.claude/statusline-command.sh
opencode:down:
desc: Removes only matching OpenCode and Claude Code links
cmds:
- rm -f {{.XDG_CONFIG_HOME}}/opencode
- rm -f {{.HOME}}/.claude/CLAUDE.md
- rm -f {{.HOME}}/.claude/skills
- rm -f {{.HOME}}/.claude/agents
- rm -f {{.HOME}}/.claude/settings.json
- rm -f {{.HOME}}/.claude/statusline-command.sh
################################################################################
# PSQL
psql:up:
desc: Configures PSQL
cmds:
- ln -sfn {{.ROOT_DIR}}/psql {{.XDG_CONFIG_HOME}}/psql
- mkdir -p {{.XDG_CACHE_HOME}}/psql
psql:down:
desc: Removes PSQL configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/psql
- rm -rf {{.XDG_CACHE_HOME}}/psql
################################################################################
ripgrep:up:
desc: Configures Ripgrep
cmds:
- ln -sfn {{.ROOT_DIR}}/ripgrep {{.XDG_CONFIG_HOME}}/ripgrep
ripgrep:down:
desc: Removes Ripgrep configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/ripgrep
################################################################################
# Ruff
ruff:up:
desc: Configures Ruff
cmds:
- ln -sfn {{.ROOT_DIR}}/ruff {{.XDG_CONFIG_HOME}}/ruff
ruff:down:
desc: Removes Ruff configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/ruff
################################################################################
# Taskfile
task:up:
desc: Configures Taskfile
cmds:
- ln -sfn {{.ROOT_DIR}}/task {{.XDG_CONFIG_HOME}}/task
task:down:
desc: Removes Taskfile configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/task
################################################################################
# TIG
tig:up:
desc: Configures TIG
cmds:
- ln -sfn {{.ROOT_DIR}}/tig {{.XDG_CONFIG_HOME}}/tig
- mkdir -p {{.XDG_DATA_HOME}}/tig
tig:down:
desc: Removes TIG configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/tig
- rm -rf {{.XDG_DATA_HOME}}/tig
################################################################################
# TMUX
tmux:up:
desc: Configures TMUX
cmds:
- ln -sfn {{.ROOT_DIR}}/tmux {{.XDG_CONFIG_HOME}}/tmux
- tic -xe tmux-256color {{.ROOT_DIR}}/tmux/tmux-256color.src
tmux:down:
desc: Removes TMUX configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/tmux
# Remove only the entry tmux:up compiled ('t' -> 0x74 bucket), not the whole
# ~/.terminfo dir (which holds other entries, eg. alacritty).
- rm -f {{.HOME}}/.terminfo/74/tmux-256color
################################################################################
# YAML Lint
yamllint:up:
desc: Configures YAML Lint
cmds:
- ln -sfn {{.ROOT_DIR}}/yamllint {{.XDG_CONFIG_HOME}}/yamllint
yamllint:down:
desc: Removes YAML Lint configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/yamllint
################################################################################
# ZSH
zsh:up:
desc: Configures ZSH
cmds:
- ln -sfn {{.ROOT_DIR}}/zsh {{.XDG_CONFIG_HOME}}/zsh
- mkdir -p {{.XDG_CACHE_HOME}}/zsh
- mkdir -p {{.XDG_DATA_HOME}}/zsh
- ln -sf {{.ROOT_DIR}}/zsh/zshenv {{.HOME}}/.zshenv
zsh:down:
desc: Removes ZSH configuration
cmds:
- rm -f {{.HOME}}/.zshenv
- rm -rf {{.XDG_CONFIG_HOME}}/zsh
- rm -rf {{.XDG_CACHE_HOME}}/zsh
################################################################################
# ALL
default:
desc: "Deploy all configuration"
cmds:
- task: ensure_xdg
- task: alacritty:up
- task: asdf:up
- task: ghostty:up
- task: bash:up
- task: bin:up
- task: docker:up
- task: fd:up
- task: fzf:up
- task: gem:up
- task: git:up
- task: gnu:up
- task: go:up
- task: helm:up
- task: homebrew:up
- task: ideavim:up
- task: k9s:up
- task: kube:up
- task: markdown:up
- task: node:up
- task: npm:up
- task: nvim:up
- task: opentofu:up
- task: opencode:up
- task: psql:up
- task: ripgrep:up
- task: ruff:up
- task: task:up
- task: tig:up
- task: tmux:up
- task: yamllint:up
- task: zsh:up